aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches
diff options
context:
space:
mode:
authorLulu13022002 <[email protected]>2024-06-23 22:24:17 +0200
committerGitHub <[email protected]>2024-06-23 22:24:17 +0200
commit97afc9a00cb8725361f43d039e412cb475f96585 (patch)
tree038b1715e09682b96cdf6fa7217ee61d800271e0 /patches
parentb2e5587a2e06219dd062eb7df0656332daf14a7a (diff)
downloadPaper-97afc9a00cb8725361f43d039e412cb475f96585.tar.gz
Paper-97afc9a00cb8725361f43d039e412cb475f96585.zip
Fix StackOverflowError for new dispenser interaction (#10949)
Diffstat (limited to 'patches')
-rw-r--r--patches/server/0952-Fix-possible-StackOverflowError-for-some-dispenses.patch11
-rw-r--r--patches/server/0956-Properly-track-the-changed-item-from-dispense-events.patch2
2 files changed, 11 insertions, 2 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
diff --git a/patches/server/0956-Properly-track-the-changed-item-from-dispense-events.patch b/patches/server/0956-Properly-track-the-changed-item-from-dispense-events.patch
index 656111c06e..2dc797fea7 100644
--- a/patches/server/0956-Properly-track-the-changed-item-from-dispense-events.patch
+++ b/patches/server/0956-Properly-track-the-changed-item-from-dispense-events.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Properly track the changed item from dispense events
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
-index f96734580a29e0436ac808e41c6cbc3f35eff5f5..7bf250bba4179a506c0a39b7866a9389552d2905 100644
+index 0c0b8a49b3342cd015381c6a93fab23c32cd32e6..60d3319016beb4f60cbc26dde165f64cf7577602 100644
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
@@ -134,10 +134,14 @@ public interface DispenseItemBehavior {