Skip to content

Commit

Permalink
Fix problem with Java VM
Browse files Browse the repository at this point in the history
  • Loading branch information
TonimatasDEV committed Feb 12, 2025
1 parent 76f735f commit ea95d78
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(Varint21FrameDecoder.class)
@Mixin(value = Varint21FrameDecoder.class, priority = 1001)
public abstract class Varint21FrameDecoderMixin {
@ModifyConstant(method = "decode", constant = @Constant(intValue = 3))
private int newSize(int value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(Varint21LengthFieldPrepender.class)
@Mixin(value = Varint21LengthFieldPrepender.class, priority = 1001)
public class Varint21LengthFieldPrependerMixin {
@ModifyConstant(method = "encode(Lio/netty/channel/ChannelHandlerContext;Lio/netty/buffer/ByteBuf;Lio/netty/buffer/ByteBuf;)V", constant = @Constant(intValue = 3))
private int newSize(int value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ public static int getDecoderSize() {

public static int getVarInt21Size() {
if (properties == null) runProperties();
return getUnlimitedPacketSize() ? Integer.MAX_VALUE : Integer.parseInt(properties.getProperty("varInt21"));
return getUnlimitedPacketSize() ? (Integer.MAX_VALUE / 2 - 1) : Integer.parseInt(properties.getProperty("varInt21"));
}

public static int getVarIntSize() {
if (properties == null) runProperties();
return getUnlimitedPacketSize() ? Integer.MAX_VALUE : Integer.parseInt(properties.getProperty("varInt"));
return getUnlimitedPacketSize() ? (Integer.MAX_VALUE / 2 - 1) : Integer.parseInt(properties.getProperty("varInt"));
}

public static int getVarLong() {
if (properties == null) runProperties();
return getUnlimitedPacketSize() ? Integer.MAX_VALUE : Integer.parseInt(properties.getProperty("varLong"));
return getUnlimitedPacketSize() ? (Integer.MAX_VALUE / 2 - 1) : Integer.parseInt(properties.getProperty("varLong"));
}

public static int getChunkPacketData() {
Expand Down

0 comments on commit ea95d78

Please sign in to comment.