-
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
b0ad615
commit e323efb
Showing
7 changed files
with
84 additions
and
12 deletions.
There are no files selected for viewing
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
15 changes: 15 additions & 0 deletions
15
common/src/main/java/dev/tonimatas/packetfixer/mixins/Varint21FrameDecoderMixin.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package dev.tonimatas.packetfixer.mixins; | ||
|
||
import dev.tonimatas.packetfixer.util.Config; | ||
import net.minecraft.network.Varint21FrameDecoder; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
|
||
@Mixin(Varint21FrameDecoder.class) | ||
public class Varint21FrameDecoderMixin { | ||
@ModifyConstant(method = "decode", constant = @Constant(intValue = 3)) | ||
private int newSize(int value) { | ||
return Config.getVarInt21Size(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
common/src/main/java/dev/tonimatas/packetfixer/mixins/Varint21LengthFieldPrependerMixin.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package dev.tonimatas.packetfixer.mixins; | ||
|
||
import dev.tonimatas.packetfixer.util.Config; | ||
import net.minecraft.network.Varint21LengthFieldPrepender; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
|
||
@Mixin(value = Varint21LengthFieldPrepender.class, priority = 9999) | ||
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) { | ||
return Config.getVarInt21Size(); | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
common/src/main/java/dev/tonimatas/packetfixer/util/MixinCheck.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package dev.tonimatas.packetfixer.util; | ||
|
||
public class MixinCheck { | ||
public static boolean with(String mixinClassName, String mixinName) { | ||
return mixinClassName.equals("dev.tonimatas.packetfixer.mixins." + mixinName); | ||
} | ||
} |
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
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