-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db758b8
commit b3ee4d4
Showing
6 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
11 changes: 9 additions & 2 deletions
11
...c/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/CustomPayloadC2SPacketMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
package net.tonimatasdev.packetfixerfabric.mixin; | ||
|
||
|
||
import net.minecraft.network.packet.c2s.common.CustomPayloadC2SPacket; | ||
import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
|
||
@Mixin(value = CustomPayloadC2SPacket.class, priority = 9999) | ||
public class CustomPayloadC2SPacketMixin { | ||
@ModifyConstant(method = "readUnknownPayload", constant = @Constant(intValue = 32767)) | ||
// <= 1.20.1 | ||
@ModifyConstant(method = "<init>(Lnet/minecraft/network/PacketByteBuf;)V", constant = @Constant(intValue = 32767)) | ||
private static int newSize(int value) { | ||
return Integer.MAX_VALUE; | ||
} | ||
|
||
// 1.20.2 | ||
//@ModifyConstant(method = "readUnknownPayload", constant = @Constant(intValue = 32767)) | ||
//private static int newSize(int value) { | ||
// return Integer.MAX_VALUE; | ||
//} | ||
} |
11 changes: 9 additions & 2 deletions
11
...c/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/CustomPayloadS2CPacketMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
package net.tonimatasdev.packetfixerfabric.mixin; | ||
|
||
import net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket; | ||
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 = "readUnknownPayload", constant = @Constant(intValue = 1048576)) | ||
// <= 1.20.1 | ||
@ModifyConstant(method = "<init>*", constant = @Constant(intValue = 1048576)) | ||
private static int newSize(int value) { | ||
return Integer.MAX_VALUE; | ||
} | ||
|
||
// 1.20.2 | ||
//@ModifyConstant(method = "readUnknownPayload", constant = @Constant(intValue = 1048576)) | ||
//private static int newSize(int value) { | ||
// return Integer.MAX_VALUE; | ||
//} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 14 additions & 3 deletions
17
.../main/java/net/tonimatasdev/packetfixerfabric/mixin/LoginQueryResponseC2SPacketMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
package net.tonimatasdev.packetfixerfabric.mixin; | ||
|
||
import net.minecraft.network.PacketByteBuf; | ||
import net.minecraft.network.packet.c2s.login.LoginQueryResponseC2SPacket; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
|
||
@Mixin(value = LoginQueryResponseC2SPacket.class, priority = 9999) | ||
public class LoginQueryResponseC2SPacketMixin { | ||
@ModifyConstant(method = "getVanillaPayload", constant = @Constant(intValue = 1048576)) | ||
private static int newSize(int value) { | ||
return Integer.MAX_VALUE; | ||
// <= 1.20.1 | ||
@ModifyVariable(method = "<init>(Lnet/minecraft/network/PacketByteBuf;)V", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/network/PacketByteBuf;readNullable(Lnet/minecraft/network/PacketByteBuf$PacketReader;)Ljava/lang/Object;"), index = 1, argsOnly = true) | ||
private PacketByteBuf redirectReadNullable(PacketByteBuf value) { | ||
return new PacketByteBuf(value.readBytes(value.readableBytes())); | ||
} | ||
|
||
|
||
// 1.20.2 | ||
//@ModifyConstant(method = "getVanillaPayload", constant = @Constant(intValue = 1048576)) | ||
//private static int newSize(int value) { | ||
// return Integer.MAX_VALUE; | ||
//} | ||
} |
2 changes: 1 addition & 1 deletion
2
fabric/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/PacketEncoderMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
fabric/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/PacketInflaterMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters