From 2c754777bb94049f7f6d618afe58a082cbf1d07e Mon Sep 17 00:00:00 2001 From: RTTV Date: Sun, 23 Jun 2024 18:04:07 -0400 Subject: [PATCH] fine then earth --- .../mixin/commands/generic/ChatScreenMixin.java | 8 -------- .../mixin/commands/reply/ChatScreenMixin.java | 16 ++++++++++++++++ src/main/resources/mixins.clientcommands.json | 1 + 3 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 src/main/java/net/earthcomputer/clientcommands/mixin/commands/reply/ChatScreenMixin.java diff --git a/src/main/java/net/earthcomputer/clientcommands/mixin/commands/generic/ChatScreenMixin.java b/src/main/java/net/earthcomputer/clientcommands/mixin/commands/generic/ChatScreenMixin.java index 00db7589a..03751cbb8 100644 --- a/src/main/java/net/earthcomputer/clientcommands/mixin/commands/generic/ChatScreenMixin.java +++ b/src/main/java/net/earthcomputer/clientcommands/mixin/commands/generic/ChatScreenMixin.java @@ -1,14 +1,11 @@ package net.earthcomputer.clientcommands.mixin.commands.generic; import net.earthcomputer.clientcommands.ClientCommands; -import net.earthcomputer.clientcommands.command.ReplyCommand; import net.earthcomputer.clientcommands.command.VarCommand; import net.minecraft.client.gui.screens.ChatScreen; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.ModifyVariable; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ChatScreen.class) public class ChatScreenMixin { @@ -22,9 +19,4 @@ private String onHandleChatInput(String message) { } return command; } - - @Inject(method = "init", at = @At("TAIL")) - private void onInit(CallbackInfo ci) { - ReplyCommand.onChatOpened(); - } } diff --git a/src/main/java/net/earthcomputer/clientcommands/mixin/commands/reply/ChatScreenMixin.java b/src/main/java/net/earthcomputer/clientcommands/mixin/commands/reply/ChatScreenMixin.java new file mode 100644 index 000000000..f952151c5 --- /dev/null +++ b/src/main/java/net/earthcomputer/clientcommands/mixin/commands/reply/ChatScreenMixin.java @@ -0,0 +1,16 @@ +package net.earthcomputer.clientcommands.mixin.commands.reply; + +import net.earthcomputer.clientcommands.command.ReplyCommand; +import net.minecraft.client.gui.screens.ChatScreen; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(ChatScreen.class) +public class ChatScreenMixin { + @Inject(method = "init", at = @At("TAIL")) + private void onInit(CallbackInfo ci) { + ReplyCommand.onChatOpened(); + } +} diff --git a/src/main/resources/mixins.clientcommands.json b/src/main/resources/mixins.clientcommands.json index 73b98659d..da6a8e198 100644 --- a/src/main/resources/mixins.clientcommands.json +++ b/src/main/resources/mixins.clientcommands.json @@ -67,6 +67,7 @@ "commands.findblock.ClientLevelMixin", "commands.generic.ClientPacketListenerMixin", "commands.generic.CommandSuggestionsMixin", + "commands.reply.ChatScreenMixin", "dataqueryhandler.ClientPacketListenerMixin", "events.ClientPacketListenerMixin", "lengthextender.ChatScreenMixin",