aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/EndCrystalItem.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/item/EndCrystalItem.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/item/EndCrystalItem.java.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/EndCrystalItem.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/EndCrystalItem.java.patch
new file mode 100644
index 0000000000..d755b53015
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/EndCrystalItem.java.patch
@@ -0,0 +1,33 @@
+--- a/net/minecraft/world/item/EndCrystalItem.java
++++ b/net/minecraft/world/item/EndCrystalItem.java
+@@ -38,15 +42,22 @@
+ if (!entities.isEmpty()) {
+ return InteractionResult.FAIL;
+ } else {
+- if (level instanceof ServerLevel) {
+- EndCrystal endCrystal = new EndCrystal(level, d + 0.5, d1, d2 + 0.5);
+- endCrystal.setShowBottom(false);
+- level.addFreshEntity(endCrystal);
+- level.gameEvent(context.getPlayer(), GameEvent.ENTITY_PLACE, blockPos);
+- EndDragonFight dragonFight = ((ServerLevel)level).getDragonFight();
+- if (dragonFight != null) {
+- dragonFight.tryRespawn();
++ if (world instanceof ServerLevel) {
++ EndCrystal entityendercrystal = new EndCrystal(world, d0 + 0.5D, d1, d2 + 0.5D);
++
++ entityendercrystal.setShowBottom(false);
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(context, entityendercrystal).isCancelled()) {
++ return InteractionResult.FAIL;
+ }
++ // CraftBukkit end
++ world.addFreshEntity(entityendercrystal);
++ world.gameEvent((Entity) context.getPlayer(), GameEvent.ENTITY_PLACE, blockposition1);
++ EndDragonFight enderdragonbattle = ((ServerLevel) world).getDragonFight();
++
++ if (enderdragonbattle != null) {
++ enderdragonbattle.tryRespawn();
++ }
+ }
+
+ context.getItemInHand().shrink(1);