13
0
geforkt von Mirrors/Paper

SPIGOT-5140: Call EntityChangeBlockEvent when a ChorusFlower is destroyed by a projectile

By: Brokkonaut <hannos17@gmx.de>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2022-03-21 13:17:54 +11:00
Ursprung ec402c4974
Commit f046a30653

Datei anzeigen

@ -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);
}