Skip to content

Commit

Permalink
Add method missing in Immersive Portals
Browse files Browse the repository at this point in the history
  • Loading branch information
TonimatasDEV committed Sep 19, 2023
1 parent 54e1d74 commit 2f867e6
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
if (mixinClassName.equalsIgnoreCase("net.tonimatasdev.packetfixerfabric.mixin.PacketInflaterMixin")) return !connectivity;
if (mixinClassName.equalsIgnoreCase("net.tonimatasdev.packetfixerfabric.mixin.compat.connectivity.PacketInflaterMixin")) return connectivity;
if (mixinClassName.equalsIgnoreCase("net.tonimatasdev.packetfixerfabric.mixin.CustomPayloadS2CPacket")) return !immersivePortals;
if (mixinClassName.equalsIgnoreCase("net.tonimatasdev.packetfixerfabric.mixin,immersiveportals.CustomPayloadS2CPacket")) return immersivePortals;

return true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package net.tonimatasdev.packetfixerfabric.mixin.compat.immersiveportals;

import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(value = CustomPayloadS2CPacket.class, priority = 9999)
public class CustomPayloadS2CPacketMixin {
@ModifyConstant(method = "<init>(Lnet/minecraft/util/Identifier;Lnet/minecraft/network/PacketByteBuf;)V", constant = @Constant(intValue = 1048576))
private int newSize(int value) {
return Integer.MAX_VALUE;
}
}
3 changes: 2 additions & 1 deletion fabric/src/main/resources/packetfixer.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"NbtTagSizeTrackerMixin",
"PacketEncoderMixin",
"PacketInflaterMixin",
"compat.connectivity.PacketInflaterMixin"
"compat.connectivity.PacketInflaterMixin",
"compat.immersiveportals.CustomPayloadS2CPacketMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
if (mixinClassName.equalsIgnoreCase("net.tonimatasdev.packetfixerforge.mixin.CompressionDecoderMixin")) return !connectivity;
if (mixinClassName.equalsIgnoreCase("net.tonimatasdev.packetfixerforge.mixin.compat.connectivity.CompressionDecoderMixin")) return connectivity;
if (mixinClassName.equalsIgnoreCase("net.tonimatasdev.packetfixerforge.mixin.ClientboundCustomPayloadPacketMixin")) return !immersivePortals;
if (mixinClassName.equalsIgnoreCase("net.tonimatasdev.packetfixerforge.mixin.compat.immersiveportals.ClientboundCustomPayloadPacketMixin")) return immersivePortals;

return true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package net.tonimatasdev.packetfixerforge.mixin.compat.immersiveportals;

import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(value = ClientboundCustomPayloadPacket.class, priority = 9999)
public class ClientboundCustomPayloadPacketMixin {
@ModifyConstant(method = "<init>(Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/network/FriendlyByteBuf;)V", constant = @Constant(intValue = 1048576))
private int newSize(int value) {
return Integer.MAX_VALUE;
}
}
3 changes: 2 additions & 1 deletion forge/src/main/resources/packetfixer.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"PacketEncoderMixin",
"ServerboundCustomPayloadPacketMixin",
"ServerboundCustomQueryPacketMixin",
"compat.connectivity.CompressionDecoderMixin"
"compat.connectivity.CompressionDecoderMixin",
"compat.immersiveportals.ClientboundCustomPayloadPacketMixin"
]
}

0 comments on commit 2f867e6

Please sign in to comment.