From 9e743bccffa9771f3e37244dc0a0ea35db989837 Mon Sep 17 00:00:00 2001 From: uku Date: Sun, 23 Oct 2022 01:25:17 +0200 Subject: [PATCH] Add config setting for grindstone overstacking (#8156) --- patches/server/Paper-config-files.patch | 2 ++ .../server/Prevent-grindstones-from-overstacking-items.patch | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/server/Paper-config-files.patch b/patches/server/Paper-config-files.patch index 1f68cb8da0..24726191d7 100644 --- a/patches/server/Paper-config-files.patch +++ b/patches/server/Paper-config-files.patch @@ -578,6 +578,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public boolean performUsernameValidation = true; + @Comment("This setting controls if players should be able to create headless pistons.") + public boolean allowHeadlessPistons = false; ++ @Comment("This setting controls if grindstones should be able to output overstacked items (such as cursed books).") ++ public boolean allowGrindstoneOverstacking = false; + } + + public Commands commands; diff --git a/patches/server/Prevent-grindstones-from-overstacking-items.patch b/patches/server/Prevent-grindstones-from-overstacking-items.patch index b3717d50b5..a9b014d0d1 100644 --- a/patches/server/Prevent-grindstones-from-overstacking-items.patch +++ b/patches/server/Prevent-grindstones-from-overstacking-items.patch @@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 itemstack2 = this.mergeEnchants(itemstack, itemstack1); if (!itemstack2.isDamageableItem()) { - if (!ItemStack.matches(itemstack, itemstack1)) { -+ if (!ItemStack.matches(itemstack, itemstack1) || itemstack2.getMaxStackSize() == 1) { // Paper - add max stack size check ++ if (!ItemStack.matches(itemstack, itemstack1) || (itemstack2.getMaxStackSize() == 1 && !io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowGrindstoneOverstacking)) { // Paper - add max stack size check & config value this.resultSlots.setItem(0, ItemStack.EMPTY); this.broadcastChanges(); return;