diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/misc/ChatFilterModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/misc/ChatFilterModule.java index 9033658..b494481 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/misc/ChatFilterModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/misc/ChatFilterModule.java @@ -22,6 +22,7 @@ public final class ChatFilterModule extends Module { public final Value unicode = new Value<>("Unicode", new String[]{"uc"}, "Reverts \"Fancy Chat\" characters back into normal ones. ", true); public final Value broadcasts = new Value<>("Broadcasts", new String[]{"broadcast", "broad", "bc"}, "Prevents displaying chat messages that begin with [SERVER].", false); + public final Value russian = new Value<>("Russian", new String[]{"russiantext", "rus", "r"}, "Prevents displaying russian-character containing messages.", false); public final Value spam = new Value<>("Spam", new String[]{"sp", "s"}, "Attempts to prevent spam by checking recent chat messages for duplicates.", true); public final Value death = new Value<>("Death", new String[]{"dead", "d"}, "Attempts to prevent death messages.", false); public final Value blue = new Value<>("BlueText", new String[]{"Blue", "b"}, "Cancels blue-text containing messages.", false); @@ -103,6 +104,14 @@ public final class ChatFilterModule extends Module { } } + if (this.russian.getValue()) { + for (int i = 0; i < packet.getChatComponent().getFormattedText().length(); i++) { + if (Character.UnicodeBlock.of(packet.getChatComponent().getFormattedText().charAt(i)).equals(Character.UnicodeBlock.CYRILLIC)) { + event.setCanceled(true); + } + } + } + if (this.unicode.getValue()) { if (packet.getChatComponent() instanceof TextComponentString) { final TextComponentString component = (TextComponentString) packet.getChatComponent();