From 3555a7776e34b46357c3d69b66976ce9c9d6c510 Mon Sep 17 00:00:00 2001 From: Bjarne Koll Date: Sun, 16 Jun 2024 00:01:55 +0200 Subject: [PATCH] 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. --- ...-track-the-changed-item-from-dispense-events.patch | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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();