From 54238beb87972bfe06d9b3539ff3603b3b1a91e4 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 23 Dec 2019 18:32:55 +0100 Subject: [PATCH] Disable book ban carpet rule --- carpetmodSrc/carpet/CarpetSettings.java | 3 +++ .../NettyVarint21FrameEncoder.java.patch | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 patches/net/minecraft/network/NettyVarint21FrameEncoder.java.patch diff --git a/carpetmodSrc/carpet/CarpetSettings.java b/carpetmodSrc/carpet/CarpetSettings.java index 54cccbe7..5defec15 100644 --- a/carpetmodSrc/carpet/CarpetSettings.java +++ b/carpetmodSrc/carpet/CarpetSettings.java @@ -360,6 +360,9 @@ private static boolean validateWorldEdit(boolean value) { * Rules in this category should end with the "Fix" suffix */ + @Rule(desc = "Disables the packet limit that causes the book banning.", category = FIX) + public static boolean disableBookBan; + @Rule(desc = "Rule made to debug recipes by pasting all recipes when crafting.", category = FIX) public static boolean debugRecipes; diff --git a/patches/net/minecraft/network/NettyVarint21FrameEncoder.java.patch b/patches/net/minecraft/network/NettyVarint21FrameEncoder.java.patch new file mode 100644 index 00000000..768ec1bc --- /dev/null +++ b/patches/net/minecraft/network/NettyVarint21FrameEncoder.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/network/NettyVarint21FrameEncoder.java ++++ ../src-work/minecraft/net/minecraft/network/NettyVarint21FrameEncoder.java +@@ -1,5 +1,6 @@ + package net.minecraft.network; + ++import carpet.CarpetSettings; + import io.netty.buffer.ByteBuf; + import io.netty.channel.ChannelHandlerContext; + import io.netty.channel.ChannelHandler.Sharable; +@@ -13,7 +14,8 @@ + int i = p_encode_2_.readableBytes(); + int j = PacketBuffer.func_150790_a(i); + +- if (j > 3) ++ // Disable this check to prevent book banning serverside. CARPET-XCOM ++ if (!CarpetSettings.disableBookBan && j > 3) + { + throw new IllegalArgumentException("unable to fit " + i + " into " + 3); + }