Add cancel config

This commit is contained in:
underscore11code authored and Josh (Vicarious) committed 2020-08-09 23:32:18 -07:00
1 parent 889e4f9fd6
commit 922c6960d5
4 files changed
+14

No files matched your search

@@ -105,4 +105,6 @@ public abstract class ChatChannel {
public String processPlaceholders(ChatUser user, String input) { return input; }
public abstract boolean isCanceled();
}
@@ -437,4 +437,8 @@ public class CarbonChatChannel extends ChatChannel {
return aliases;
}
@Override
public boolean isCanceled() {
return getBoolean("cancel");
}
}
@@ -25,6 +25,9 @@ public class BukkitChatListener implements Listener {
ChatUser user = carbonChat.getUserService().wrap(event.getPlayer());
ChatChannel channel = user.getSelectedChannel();
if (channel.isCanceled()) event.setCancelled(true);
carbonChat.getLogger().info(String.format("Message sent, canceled: %s", event.isCancelled()));
for (ChatChannel entry : carbonChat.getChannelManager().getRegistry().values()) {
if (entry.getMessagePrefix() == null) {
continue;