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.
This commit is contained in:
Bjarne Koll 2024-06-16 00:01:55 +02:00
parent cffcda2bc7
commit 26f246b908

View file

@ -36,6 +36,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
ArmorStand entityarmorstand = (ArmorStand) EntityType.ARMOR_STAND.spawn(worldserver, consumer, blockposition, MobSpawnType.DISPENSER, false, false);
if (entityarmorstand != null) {
@@ -0,0 +0,0 @@ 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);
@@ -0,0 +0,0 @@ public interface DispenseItemBehavior {
int y = blockposition.getY();
int z = blockposition.getZ();