mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Add cancel config
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user