mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-10 22:05:10 +01:00
SPIGOT-5140: Call EntityChangeBlockEvent when a ChorusFlower is destroyed by a projectile
By: Brokkonaut <hannos17@gmx.de>
This commit is contained in:
parent
ec402c4974
commit
f046a30653
@ -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…
Reference in New Issue
Block a user