mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-08-21 05:44:33 +00:00
SPIGOT-5140: Call EntityChangeBlockEvent when a ChorusFlower is destroyed by a projectile
This commit is contained in:
parent
e9f972d674
commit
3ec79a27d4
1 changed files with 12 additions and 0 deletions
|
@ -59,3 +59,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -245,6 +263,11 @@
|
||||||
|
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
|
||||||
|
|
||||||
|
if (!world.isClientSide && iprojectile.mayInteract(world, blockposition) && iprojectile.getType().is(TagsEntity.IMPACT_PROJECTILES)) {
|
||||||
|
+ // CraftBukkit start
|
||||||
|
+ if (CraftEventFactory.callEntityChangeBlockEvent(iprojectile, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
world.destroyBlock(blockposition, true, iprojectile);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue