diff --git a/src/main/java/io/github/null2264/cobblegen/mixin/network/ClientCommonPacketListenerMixin.java b/src/main/java/io/github/null2264/cobblegen/mixin/network/ClientCommonPacketListenerMixin.java index 1e3f88c..1af076d 100644 --- a/src/main/java/io/github/null2264/cobblegen/mixin/network/ClientCommonPacketListenerMixin.java +++ b/src/main/java/io/github/null2264/cobblegen/mixin/network/ClientCommonPacketListenerMixin.java @@ -3,15 +3,17 @@ //#if MC<1.20.2 import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket; //#else -//#if MC>=1.20.4 && MC<1.20.5 +//#if MC>=1.20.4 +//$$ import net.minecraft.network.protocol.Packet; +//$$ import io.github.null2264.cobblegen.network.payload.CGPacketPayload; +//$$ import net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket; +//#if MC<1.20.5 //$$ import com.llamalad7.mixinextras.injector.ModifyExpressionValue; -//#else if MC>=1.20.5 +//#else //$$ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; //$$ import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -//$$ import io.github.null2264.cobblegen.network.payload.CGPacketPayload; -//$$ import net.minecraft.network.protocol.Packet; //$$ import net.minecraft.network.protocol.common.ClientCommonPacketListener; -//$$ import net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket; +//#endif //#endif //$$ import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket; //#endif @@ -68,8 +70,8 @@ private void handleDisconnect(Component reason, CallbackInfo ci) { } //#endif - //#if FORGE>1 - //#if MC>=1.20.4 && MC<1.20.5 + //#if MC>=1.20.4 && FORGE>1 + //#if MC<1.20.5 //$$ @ModifyExpressionValue( //$$ method = "send", //$$ at = @At(value = "INVOKE", target = "Lnet/neoforged/neoforge/network/registration/NetworkRegistry;canSendPacket(Lnet/minecraft/network/protocol/Packet;Lnet/minecraft/network/protocol/common/ClientCommonPacketListener;)Z") diff --git a/src/main/java/io/github/null2264/cobblegen/mixin/network/ServerCommonPacketListenerMixin.java b/src/main/java/io/github/null2264/cobblegen/mixin/network/ServerCommonPacketListenerMixin.java index 4e3dff8..f9cd64b 100644 --- a/src/main/java/io/github/null2264/cobblegen/mixin/network/ServerCommonPacketListenerMixin.java +++ b/src/main/java/io/github/null2264/cobblegen/mixin/network/ServerCommonPacketListenerMixin.java @@ -3,16 +3,18 @@ //#if MC<1.20.2 import net.minecraft.network.protocol.game.ServerboundCustomPayloadPacket; //#else -//#if MC>=1.20.4 && MC<1.20.5 -//$$ import com.llamalad7.mixinextras.injector.ModifyExpressionValue; -//#else if MC>=1.20.5 -//$$ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -//$$ import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +//#if MC>=1.20.4 //$$ import io.github.null2264.cobblegen.network.payload.CGPacketPayload; //$$ import net.minecraft.network.protocol.Packet; //$$ import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket; +//#if MC<1.20.5 +//$$ import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +//#else +//$$ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +//$$ import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; //$$ import net.minecraft.network.protocol.common.ServerCommonPacketListener; //#endif +//#endif //$$ import net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket; //#endif @@ -70,8 +72,8 @@ private void handleCustomPayload(ServerboundCustomPayloadPacket packet, Callback } } - //#if FORGE>1 - //#if MC>=1.20.4 && MC<1.20.5 + //#if MC>=1.20.4 && FORGE>1 + //#if MC<1.20.5 //$$ @ModifyExpressionValue( //$$ method = "send(Lnet/minecraft/network/protocol/Packet;Lnet/minecraft/network/PacketSendListener;)V", //$$ at = @At(value = "INVOKE", target = "Lnet/neoforged/neoforge/network/registration/NetworkRegistry;canSendPacket(Lnet/minecraft/network/protocol/Packet;Lnet/minecraft/network/protocol/common/ServerCommonPacketListener;)Z")