From 71a2187c20c145079d131d63528179dc1372ec50 Mon Sep 17 00:00:00 2001 From: maxcom1 <46265094+maxcom1@users.noreply.github.com> Date: Wed, 20 Mar 2024 20:35:10 +0100 Subject: [PATCH] Fire EntityChangeBlockEvent on beehive nectar deposit (#10306) * Add BeehiveNectarDepositEvent * Fire EntityChangeBlockEvent instead of a separate event --- ...ntityChangeBlockEvent-in-more-places.patch | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch b/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch index 3fcb8f64b6..11e9750d4f 100644 --- a/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch +++ b/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch @@ -4,6 +4,7 @@ Date: Mon, 9 Aug 2021 20:45:46 -0700 Subject: [PATCH] Fire EntityChangeBlockEvent in more places Co-authored-by: ChristopheG <61288881+chrisgdt@users.noreply.github.com> +Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com> diff --git a/src/main/java/net/minecraft/world/entity/LightningBolt.java b/src/main/java/net/minecraft/world/entity/LightningBolt.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -300,6 +301,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 generatoraccess.setBlock(blockposition, iblockdata1, 3); generatoraccess.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.Context.of(entity, iblockdata1)); +diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +@@ -0,0 +0,0 @@ public class BeehiveBlockEntity extends BlockEntity { + --j; + } + +- world.setBlockAndUpdate(blockposition, (BlockState) iblockdata.setValue(BeehiveBlock.HONEY_LEVEL, i + j)); ++ // Paper start - Fire EntityChangeBlockEvent in more places ++ BlockState newBlockState = iblockdata.setValue(BeehiveBlock.HONEY_LEVEL, i + j); ++ ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entitybee, blockposition, newBlockState)) { ++ world.setBlockAndUpdate(blockposition, newBlockState); ++ } ++ // Paper end - Fire EntityChangeBlockEvent in more places + } + } + } diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java