diff options
author | Linnea Gräf <nea@nea.moe> | 2024-12-23 23:02:08 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-12-23 23:02:08 +0100 |
commit | 656958937fe29da90d7229b979996a68b5ea5b67 (patch) | |
tree | 20396137c6f933194cc8cc612f08d3b35dce0094 /src/main/java/moe/nea/firmament/mixins/SaveOriginalCommandTreePacket.java | |
parent | 22bc3adbae747ef00e679458b0d407df31a9079b (diff) | |
download | Firmament-656958937fe29da90d7229b979996a68b5ea5b67.tar.gz Firmament-656958937fe29da90d7229b979996a68b5ea5b67.tar.bz2 Firmament-656958937fe29da90d7229b979996a68b5ea5b67.zip |
feat: Add /dh command
Diffstat (limited to 'src/main/java/moe/nea/firmament/mixins/SaveOriginalCommandTreePacket.java')
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/SaveOriginalCommandTreePacket.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/SaveOriginalCommandTreePacket.java b/src/main/java/moe/nea/firmament/mixins/SaveOriginalCommandTreePacket.java new file mode 100644 index 0000000..2f2f188 --- /dev/null +++ b/src/main/java/moe/nea/firmament/mixins/SaveOriginalCommandTreePacket.java @@ -0,0 +1,17 @@ +package moe.nea.firmament.mixins; + +import moe.nea.firmament.features.chat.QuickCommands; +import net.minecraft.client.network.ClientPlayNetworkHandler; +import net.minecraft.network.packet.s2c.play.CommandTreeS2CPacket; +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(ClientPlayNetworkHandler.class) +public class SaveOriginalCommandTreePacket { + @Inject(method = "onCommandTree", at = @At(value = "RETURN")) + private void saveUnmodifiedCommandTree(CommandTreeS2CPacket packet, CallbackInfo ci) { + QuickCommands.INSTANCE.setLastReceivedTreePacket(packet); + } +} |