diff options
author | Linnea Gräf <nea@nea.moe> | 2024-08-12 22:15:07 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-08-12 22:15:07 +0200 |
commit | b8a45b9a0438a12ba3c609f6e416d519829471be (patch) | |
tree | aff190bb953d94f1187896b2c245644a29e6badf /src/main/java/moe/nea/firmament/mixins/custompayload/SplitJoinedCustomPayload.java | |
parent | 3c7e6b6177de6ef3cff8a46bb1726466a299cdde (diff) | |
download | firmament-b8a45b9a0438a12ba3c609f6e416d519829471be.tar.gz firmament-b8a45b9a0438a12ba3c609f6e416d519829471be.tar.bz2 firmament-b8a45b9a0438a12ba3c609f6e416d519829471be.zip |
Improve location and profile detection
Diffstat (limited to 'src/main/java/moe/nea/firmament/mixins/custompayload/SplitJoinedCustomPayload.java')
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/custompayload/SplitJoinedCustomPayload.java | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/custompayload/SplitJoinedCustomPayload.java b/src/main/java/moe/nea/firmament/mixins/custompayload/SplitJoinedCustomPayload.java deleted file mode 100644 index 5320a13..0000000 --- a/src/main/java/moe/nea/firmament/mixins/custompayload/SplitJoinedCustomPayload.java +++ /dev/null @@ -1,28 +0,0 @@ - -package moe.nea.firmament.mixins.custompayload; - -import moe.nea.firmament.apis.ingame.JoinedCustomPayload; -import net.minecraft.network.listener.ClientCommonPacketListener; -import net.minecraft.network.packet.CustomPayload; -import net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(CustomPayloadS2CPacket.class) -public abstract class SplitJoinedCustomPayload { - - @Shadow - public abstract CustomPayload payload(); - - @Inject(method = "apply(Lnet/minecraft/network/listener/ClientCommonPacketListener;)V", at = @At("HEAD"), cancellable = true) - private void onApply(ClientCommonPacketListener clientCommonPacketListener, CallbackInfo ci) { - if (payload() instanceof JoinedCustomPayload joinedCustomPayload) { - new CustomPayloadS2CPacket(joinedCustomPayload.getOriginal()).apply(clientCommonPacketListener); - new CustomPayloadS2CPacket(joinedCustomPayload.getSmuggled()).apply(clientCommonPacketListener); - ci.cancel(); - } - } -} |