Add component forwarding

This commit is contained in:
Draycia committed 2020-06-26 04:03:20 -07:00
1 parent 95cfa7db52
commit dc9d7c84c0
7 files changed
+107 -13

No files matched your search

@@ -1,6 +1,7 @@
package net.draycia.simplechat.channels;
import net.draycia.simplechat.SimpleChat;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
@@ -100,6 +101,13 @@ public abstract class ChatChannel {
*/
public abstract boolean canPlayerUse(Player player);
/**
* @return If the channel should forward its formatting / formatted message to other servers
*/
public boolean shouldForwardFormatting() {
return true;
}
/**
* Parses the specified message, calls a {@link net.draycia.simplechat.events.ChannelChatEvent}, and sends the message to everyone who can view this channel.
* @param player The player who is saying the message.
@@ -107,6 +115,8 @@ public abstract class ChatChannel {
*/
public abstract void sendMessage(OfflinePlayer player, String message);
public abstract void sendComponent(OfflinePlayer player, Component component);
public abstract void processDiscordMessage(MessageCreateEvent event);
public static abstract class Builder {
@@ -123,6 +133,7 @@ public abstract class ChatChannel {
public abstract ChatChannel.Builder setSwitchMessage(String switchMessage);
public abstract ChatChannel.Builder setToggleOffMessage(String toggleOffMessage);
public abstract ChatChannel.Builder setToggleOnMessage(String toggleOnMessage);
public abstract ChatChannel.Builder setShouldForwardFormatting(boolean forwardFormatting);
}
}