diff options
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(); - } - } -} |