diff options
Diffstat (limited to 'patches/server/0952-Fix-possible-StackOverflowError-for-some-dispenses.patch')
-rw-r--r-- | patches/server/0952-Fix-possible-StackOverflowError-for-some-dispenses.patch | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/patches/server/0952-Fix-possible-StackOverflowError-for-some-dispenses.patch b/patches/server/0952-Fix-possible-StackOverflowError-for-some-dispenses.patch index 5a6627392e..5351dde83c 100644 --- a/patches/server/0952-Fix-possible-StackOverflowError-for-some-dispenses.patch +++ b/patches/server/0952-Fix-possible-StackOverflowError-for-some-dispenses.patch @@ -14,7 +14,7 @@ Additionally equippable mob heads, wither skulls, and carved pumpkins are subject to the same possible error. diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index 7826e2a52da47914aca39fef958b8f398a2ff937..f96734580a29e0436ac808e41c6cbc3f35eff5f5 100644 +index 7826e2a52da47914aca39fef958b8f398a2ff937..0c0b8a49b3342cd015381c6a93fab23c32cd32e6 100644 --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java @@ -239,7 +239,7 @@ public interface DispenseItemBehavior { @@ -71,6 +71,15 @@ index 7826e2a52da47914aca39fef958b8f398a2ff937..f96734580a29e0436ac808e41c6cbc3f } return stack; +@@ -918,7 +918,7 @@ 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 fb518f87cc4ccd810fb32cade2fdd7e09ab0abfc..647a4601deace52f8d855f512a73671f82b4762a 100644 --- a/src/main/java/net/minecraft/world/item/ArmorItem.java |