aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjarne Koll <[email protected]>2024-06-16 00:01:55 +0200
committerBjarne Koll <[email protected]>2024-06-16 00:01:55 +0200
commit3555a7776e34b46357c3d69b66976ce9c9d6c510 (patch)
treed70eeaa6669f9c1706c51b98443d270ac25b3be7
parent7df472527f94ee518faa038bdd0168edb6aebada (diff)
downloadPaper-3555a7776e34b46357c3d69b66976ce9c9d6c510.tar.gz
Paper-3555a7776e34b46357c3d69b66976ce9c9d6c510.zip
Properly forward DispenseEvent #getItem to saddle
Correctly use the DispenseEvent's #getItem ItemStack when placing the saddle on entities during a dispense behaviour instead of the original stack.
-rw-r--r--patches/server/0957-Properly-track-the-changed-item-from-dispense-events.patch11
1 files changed, 10 insertions, 1 deletions
diff --git a/patches/server/0957-Properly-track-the-changed-item-from-dispense-events.patch b/patches/server/0957-Properly-track-the-changed-item-from-dispense-events.patch
index f0c05e1f86..656111c06e 100644
--- a/patches/server/0957-Properly-track-the-changed-item-from-dispense-events.patch
+++ b/patches/server/0957-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..9d71388c6e8ff56228afbf8cb18c37f861d0b246 100644
+index f96734580a29e0436ac808e41c6cbc3f35eff5f5..7bf250bba4179a506c0a39b7866a9389552d2905 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 {
@@ -36,6 +36,15 @@ index f96734580a29e0436ac808e41c6cbc3f35eff5f5..9d71388c6e8ff56228afbf8cb18c37f8
ArmorStand entityarmorstand = (ArmorStand) EntityType.ARMOR_STAND.spawn(worldserver, consumer, blockposition, MobSpawnType.DISPENSER, false, false);
if (entityarmorstand != null) {
+@@ -244,7 +249,7 @@ public interface DispenseItemBehavior {
+ return stack;
+ }
+ }
+- ((Saddleable) list.get(0)).equipSaddle(itemstack1, SoundSource.BLOCKS);
++ ((Saddleable) list.get(0)).equipSaddle(CraftItemStack.asNMSCopy(event.getItem()), SoundSource.BLOCKS); // Paper - track changed items in dispense event
+ // CraftBukkit end
+ if (shrink) stack.shrink(1); // Paper - actually handle here
+ this.setSuccess(true);
@@ -414,6 +419,7 @@ public interface DispenseItemBehavior {
int y = blockposition.getY();
int z = blockposition.getZ();