Don't send chat message if it was blocked
This commit is contained in:
@@ -35,7 +35,10 @@ public class ChatListener implements Listener, ChatRenderer {
|
|||||||
String message = PlainComponentSerializer.plain().serialize(input);
|
String message = PlainComponentSerializer.plain().serialize(input);
|
||||||
|
|
||||||
message = RegexManager.replaceText(message); // todo a better way for this
|
message = RegexManager.replaceText(message); // todo a better way for this
|
||||||
if(message == null) return; // the message was blocked
|
if(message == null) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return; // the message was blocked
|
||||||
|
}
|
||||||
|
|
||||||
MiniMessage miniMessage = MiniMessage.get();
|
MiniMessage miniMessage = MiniMessage.get();
|
||||||
if(!player.hasPermission("chat.format")) {
|
if(!player.hasPermission("chat.format")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user