From 2d0771add837da29f6c3779f0422e0d5a46bb9da Mon Sep 17 00:00:00 2001 From: Chipmunk <65827213+ChipmunkMC@users.noreply.github.com> Date: Wed, 21 Jun 2023 14:53:34 -0400 Subject: [PATCH] fix chat --- .../chipmunkbot/systemChat/KaboomChatParser.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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); } }