PAPI support

This commit is contained in:
Draycia committed 2021-09-17 18:08:40 -07:00
1 parent 6cde90d39b
commit bb68ba0923
12 files changed
+186 -18

No files matched your search

@@ -3,6 +3,9 @@ package net.draycia.carbon.api;
import java.nio.file.Path;
import net.draycia.carbon.api.channels.ChannelRegistry;
import net.draycia.carbon.api.events.CarbonEventHandler;
import net.draycia.carbon.api.util.SourcedAudience;
import net.kyori.adventure.text.Component;
import net.kyori.moonshine.message.IMessageRenderer;
import org.apache.logging.log4j.Logger;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier;
@@ -58,4 +61,6 @@ public interface CarbonChat {
*/
ChannelRegistry channelRegistry();
IMessageRenderer<SourcedAudience, String, Component, Component> messageRenderer();
}
@@ -183,4 +183,12 @@ public interface CarbonPlayer extends Audience, Identified {
// TODO: change return type, provide information useful like what message was actually sent?
void sendMessageAsPlayer(final String message);
/**
* Returns whether or not the player is online.
*
* @return if the player is online.
* @since 2.0.0
*/
boolean online();
}
@@ -0,0 +1,11 @@
package net.draycia.carbon.api.util;
import net.kyori.adventure.audience.Audience;
public record SourcedAudience(Audience sender, Audience recipient) {
public static SourcedAudience empty() {
return new SourcedAudience(Audience.empty(), Audience.empty());
}
}