diff --git a/src/main/java/land/chipmunk/chipmunkbot/systemChat/KaboomChatParser.java b/src/main/java/land/chipmunk/chipmunkbot/systemChat/KaboomChatParser.java index f7b0760..c283e29 100644 --- a/src/main/java/land/chipmunk/chipmunkbot/systemChat/KaboomChatParser.java +++ b/src/main/java/land/chipmunk/chipmunkbot/systemChat/KaboomChatParser.java @@ -21,17 +21,12 @@ public class KaboomChatParser implements SystemChatParser { this.client = client; } private static Component SEPERATOR_COLON = Component.text(":"); + private static Component SEPERATOR_COLON_RACCOON = Component.text("\u00a7f:"); // https://github.com/raccoonserver/extras/commit/315f704075db2f00e3e1bfbf55f858469c22880f private static Component SEPERATOR_SPACE = Component.space(); @Override public PlayerMessage parse (Component message) { if (message instanceof TextComponent) return parse((TextComponent) message); - if (message instanceof TranslatableComponent) return parse((TranslatableComponent) message); - return null; - } - - public PlayerMessage parse (TranslatableComponent message) { - if (message.key().equals("%s") && message.args() != null && message.args().size() == 1 && message.style().isEmpty()) return parse(message.args().get(0)); return null; } @@ -59,6 +54,6 @@ public class KaboomChatParser implements SystemChatParser { } private boolean isSeperatorAt (List children, int start) { - return children.get(start).equals(SEPERATOR_COLON) && children.get(start + 1).equals(SEPERATOR_SPACE); + return (children.get(start).equals(SEPERATOR_COLON) || children.get(start).equals(SEPERATOR_COLON_RACCOON)) && children.get(start + 1).equals(SEPERATOR_SPACE); } }