PaperMC/nms-patches/ItemArmorStand.patch

15 lines
1 KiB
Diff
Raw Normal View History

2018-10-22 21:00:00 +02:00
--- a/net/minecraft/server/ItemArmorStand.java
+++ b/net/minecraft/server/ItemArmorStand.java
2019-04-23 04:00:00 +02:00
@@ -41,6 +41,11 @@
2018-10-22 21:00:00 +02:00
entityarmorstand.setPositionRotation(d0 + 0.5D, d1, d2 + 0.5D, f, 0.0F);
this.a(entityarmorstand, world.random);
2019-04-23 04:00:00 +02:00
EntityTypes.a(world, itemactioncontext.getEntity(), (Entity) entityarmorstand, itemstack.getTag());
2018-10-22 21:00:00 +02:00
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(itemactioncontext, entityarmorstand).isCancelled()) {
+ return EnumInteractionResult.FAIL;
+ }
+ // CraftBukkit end
world.addEntity(entityarmorstand);
2019-12-10 23:00:00 +01:00
world.playSound((EntityHuman) null, entityarmorstand.locX(), entityarmorstand.locY(), entityarmorstand.locZ(), SoundEffects.ENTITY_ARMOR_STAND_PLACE, SoundCategory.BLOCKS, 0.75F, 0.8F);
2018-10-22 21:00:00 +02:00
}