PaperMC/paper-server/nms-patches/net/minecraft/world/item/ItemArmorStand.patch
CraftBukkit/Spigot 8b26bb8f3e Update to Minecraft 1.19.3
By: md_5 <git@md-5.net>
2022-12-08 03:00:00 +11:00

14 lines
1,023 B
Diff

--- a/net/minecraft/world/item/ItemArmorStand.java
+++ b/net/minecraft/world/item/ItemArmorStand.java
@@ -57,6 +57,11 @@
entityarmorstand.moveTo(entityarmorstand.getX(), entityarmorstand.getY(), entityarmorstand.getZ(), f, 0.0F);
this.randomizePose(entityarmorstand, world.random);
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(itemactioncontext, entityarmorstand).isCancelled()) {
+ return EnumInteractionResult.FAIL;
+ }
+ // CraftBukkit end
worldserver.addFreshEntityWithPassengers(entityarmorstand);
world.playSound((EntityHuman) null, entityarmorstand.getX(), entityarmorstand.getY(), entityarmorstand.getZ(), SoundEffects.ARMOR_STAND_PLACE, SoundCategory.BLOCKS, 0.75F, 0.8F);
entityarmorstand.gameEvent(GameEvent.ENTITY_PLACE, itemactioncontext.getPlayer());