From f046a306538312ac8c672868c81fc9ad52ed62ee Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 21 Mar 2022 13:17:54 +1100 Subject: [PATCH] SPIGOT-5140: Call EntityChangeBlockEvent when a ChorusFlower is destroyed by a projectile By: Brokkonaut --- .../world/level/block/BlockChorusFlower.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockChorusFlower.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockChorusFlower.patch index 5cbbfb3bf3..6d58af30ac 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockChorusFlower.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockChorusFlower.patch @@ -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); + } +