Commits

Brokkonaut authored and md_5 committed 3ec79a27d4f
SPIGOT-5140: Call EntityChangeBlockEvent when a ChorusFlower is destroyed by a projectile
No tags

nms-patches/net/minecraft/world/level/block/BlockChorusFlower.patch

Modified
52 52 } else {
53 53 - this.placeDeadFlower(worldserver, blockposition);
54 54 + // CraftBukkit - add event
55 55 + if (CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, this.defaultBlockState().setValue(BlockChorusFlower.AGE, Integer.valueOf(5)), 2)) {
56 56 + this.placeDeadFlower(worldserver, blockposition);
57 57 + }
58 58 + // CraftBukkit end
59 59 }
60 60
61 61 }
62 +@@ -245,6 +263,11 @@
63 + BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
64 +
65 + if (!world.isClientSide && iprojectile.mayInteract(world, blockposition) && iprojectile.getType().is(TagsEntity.IMPACT_PROJECTILES)) {
66 ++ // CraftBukkit start
67 ++ if (CraftEventFactory.callEntityChangeBlockEvent(iprojectile, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) {
68 ++ return;
69 ++ }
70 ++ // CraftBukkit end
71 + world.destroyBlock(blockposition, true, iprojectile);
72 + }
73 +

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut