Skip to content

Commit

Permalink
Disable book ban carpet rule
Browse files Browse the repository at this point in the history
  • Loading branch information
X-com committed Dec 23, 2019
1 parent 0e60cdd commit 54238be
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions carpetmodSrc/carpet/CarpetSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
19 changes: 19 additions & 0 deletions patches/net/minecraft/network/NettyVarint21FrameEncoder.java.patch
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 54238be

Please sign in to comment.