From b8a45b9a0438a12ba3c609f6e416d519829471be Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Mon, 12 Aug 2024 22:15:07 +0200 Subject: Improve location and profile detection --- .../custompayload/SplitJoinedCustomPayload.java | 28 ---------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/main/java/moe/nea/firmament/mixins/custompayload/SplitJoinedCustomPayload.java (limited to 'src/main/java/moe/nea/firmament/mixins/custompayload/SplitJoinedCustomPayload.java') 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(); - } - } -} -- cgit