diff --git a/patches/server/Fix-possible-StackOverflowError-for-some-dispenses.patch b/patches/server/Fix-possible-StackOverflowError-for-some-dispenses.patch index 970b709704..058db9b15e 100644 --- a/patches/server/Fix-possible-StackOverflowError-for-some-dispenses.patch +++ b/patches/server/Fix-possible-StackOverflowError-for-some-dispenses.patch @@ -71,6 +71,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } return stack; +@@ -0,0 +0,0 @@ public interface DispenseItemBehavior { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); + DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); +- if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != ArmorItem.DISPENSE_ITEM_BEHAVIOR) { ++ if (idispensebehavior != DispenseItemBehavior.NOOP && idispensebehavior != this) { // Paper - fix possible StackOverflowError + idispensebehavior.dispense(pointer, eventStack); + return stack; + } diff --git a/src/main/java/net/minecraft/world/item/ArmorItem.java b/src/main/java/net/minecraft/world/item/ArmorItem.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/ArmorItem.java