PaperMC/paper-server/nms-patches/net/minecraft/world/item/ItemEndCrystal.patch
CraftBukkit/Spigot 25f3b50f6b Update to Minecraft 1.19
By: md_5 <git@md-5.net>
2022-06-08 02:00:00 +10:00

14 lines
934 B
Diff

--- a/net/minecraft/world/item/ItemEndCrystal.java
+++ b/net/minecraft/world/item/ItemEndCrystal.java
@@ -46,6 +46,11 @@
EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(world, d0 + 0.5D, d1, d2 + 0.5D);
entityendercrystal.setShowBottom(false);
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(itemactioncontext, entityendercrystal).isCancelled()) {
+ return EnumInteractionResult.FAIL;
+ }
+ // CraftBukkit end
world.addFreshEntity(entityendercrystal);
world.gameEvent((Entity) itemactioncontext.getPlayer(), GameEvent.ENTITY_PLACE, blockposition1);
EnderDragonBattle enderdragonbattle = ((WorldServer) world).dragonFight();