diff --git a/src/main/java/land/chipmunk/chipmunkbot/plugins/CommandSpyPlugin.java b/src/main/java/land/chipmunk/chipmunkbot/plugins/CommandSpyPlugin.java index f68355a..8338909 100644 --- a/src/main/java/land/chipmunk/chipmunkbot/plugins/CommandSpyPlugin.java +++ b/src/main/java/land/chipmunk/chipmunkbot/plugins/CommandSpyPlugin.java @@ -19,12 +19,14 @@ public class CommandSpyPlugin extends ChatPlugin.Listener { private static final Style ENABLED_STYLE = Style.style(NamedTextColor.YELLOW); private static final Style DISABLED_STYLE = Style.style(NamedTextColor.AQUA); - private static final Component COMMANDSPY_ENABLED_COMPONENT = Component + private static final Component COMMANDSPY_ENABLED_COMPONENT = Component.text("Successfully enabled CommandSpy"); + private static final Component COMMANDSPY_DISABLED_COMPONENT = Component.text("Successfully disabled CommandSpy"); + private static final Component COMMANDSPY_ENABLED_COMPONENT_CHIPMUNK = Component .empty() .append(Component.text("Successfully ")) .append(Component.text("enabled")) .append(Component.text(" CommandSpy")); - private static final Component COMMANDSPY_DISABLED_COMPONENT = Component + private static final Component COMMANDSPY_DISABLED_COMPONENT_CHIPMUNK = Component .empty() .append(Component.text("Successfully ")) .append(Component.text("disabled")) @@ -42,8 +44,8 @@ public class CommandSpyPlugin extends ChatPlugin.Listener { public void systemMessageReceived (Component component, boolean overlay) { if (overlay || !(component instanceof final TextComponent t_component)) return; - if (component.equals(COMMANDSPY_ENABLED_COMPONENT)) { this.enabled = true; return; } - if (component.equals(COMMANDSPY_DISABLED_COMPONENT)) { this.enabled = false; return; } + if (component.equals(COMMANDSPY_ENABLED_COMPONENT) || component.equals(COMMANDSPY_ENABLED_COMPONENT_CHIPMUNK)) { this.enabled = true; return; } + if (component.equals(COMMANDSPY_DISABLED_COMPONENT) || component.equals(COMMANDSPY_DISABLED_COMPONENT_CHIPMUNK)) { this.enabled = false; return; } final boolean enabled = component.style().equals(ENABLED_STYLE); if (!enabled && !component.style().equals(DISABLED_STYLE)) return;