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