summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemEndCrystal.patch
blob: 6173162a837d10e2a9836d0d9dcec748ae8bef7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--- a/net/minecraft/server/ItemEndCrystal.java
+++ b/net/minecraft/server/ItemEndCrystal.java
@@ -33,6 +33,11 @@
                         EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(world, d0 + 0.5D, d1, d2 + 0.5D);
 
                         entityendercrystal.setShowingBottom(false);
+                        // CraftBukkit start
+                        if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(itemactioncontext, entityendercrystal).isCancelled()) {
+                            return EnumInteractionResult.FAIL;
+                        }
+                        // CraftBukkit end
                         world.addEntity(entityendercrystal);
                         if (world.worldProvider instanceof WorldProviderTheEnd) {
                             EnderDragonBattle enderdragonbattle = ((WorldProviderTheEnd) world.worldProvider).r();