From 49327ce22e0a3cdc3d6c995e90713e3d1c18569f Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Tue, 4 Jul 2023 16:26:38 +0700 Subject: [PATCH] fart? --- .../land/chipmunk/chipmunkmod/mixin/ChatHudMixin.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatHudMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatHudMixin.java index 77d8f38..5d0075c 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatHudMixin.java +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatHudMixin.java @@ -6,8 +6,6 @@ import land.chipmunk.chipmunkmod.listeners.Listener; import land.chipmunk.chipmunkmod.listeners.ListenerManager; import land.chipmunk.chipmunkmod.modules.ChatInputGlobals; import land.chipmunk.chipmunkmod.modules.RainbowName; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.TextComponent; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.hud.MessageIndicator; import net.minecraft.client.gui.screen.ChatScreen; @@ -45,19 +43,17 @@ public class ChatHudMixin { } try { - final Component component = message.asComponent(); - - final List children = component.children(); + final List children = message.getSiblings(); if (children.size() == 0) return; - if (!((TextComponent) children.get(0)).content().equals("chomens_bot_command_suggestion")) return; + if (!children.get(0).getString().equals("chomens_bot_command_suggestion")) return; ci.cancel(); final String[] matches = children.subList(2, children.size()) .stream() - .map((each) -> ((TextComponent) each).content()) + .map(Text::getString) .toArray(String[]::new); if (!(MinecraftClient.getInstance().currentScreen instanceof ChatScreen chatScreen)) return;