summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemArmorStand.patch
blob: 08587855cb4a921fd3fa183e88c09ec19ba1c074 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--- a/net/minecraft/server/ItemArmorStand.java
+++ b/net/minecraft/server/ItemArmorStand.java
@@ -40,6 +40,11 @@
                         entityarmorstand.setPositionRotation(d0 + 0.5D, d1, d2 + 0.5D, f, 0.0F);
                         this.a(entityarmorstand, world.random);
                         EntityTypes.a(world, itemactioncontext.getEntity(), entityarmorstand, itemstack.getTag());
+                        // CraftBukkit start
+                        if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(itemactioncontext, entityarmorstand).isCancelled()) {
+                            return EnumInteractionResult.FAIL;
+                        }
+                        // CraftBukkit end
                         world.addEntity(entityarmorstand);
                         world.a((EntityHuman) null, entityarmorstand.locX, entityarmorstand.locY, entityarmorstand.locZ, SoundEffects.ENTITY_ARMOR_STAND_PLACE, SoundCategory.BLOCKS, 0.75F, 0.8F);
                     }