From bd77b78e4f8b6fb040c5ba7efaaa826565f24b6e Mon Sep 17 00:00:00 2001 From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Date: Sat, 11 Feb 2023 18:14:03 +0100 Subject: [PATCH] Fix desync of honeycomb when the event is canceled (#8713) --- .../0888-Fire-EntityChangeBlockEvent-in-more-places.patch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/patches/server/0888-Fire-EntityChangeBlockEvent-in-more-places.patch b/patches/server/0888-Fire-EntityChangeBlockEvent-in-more-places.patch index a006824b2c..954dc118cf 100644 --- a/patches/server/0888-Fire-EntityChangeBlockEvent-in-more-places.patch +++ b/patches/server/0888-Fire-EntityChangeBlockEvent-in-more-places.patch @@ -111,15 +111,18 @@ index e0c3aa1285709a40ff0ea8c1d74d43d2b341aecc..f4fc8ff3981555e4b560289248a9b02a Block.pushEntitiesUp(iblockdata, iblockdata1, world, blockposition); world.setBlock(blockposition, iblockdata1, 2); diff --git a/src/main/java/net/minecraft/world/item/HoneycombItem.java b/src/main/java/net/minecraft/world/item/HoneycombItem.java -index 68a8d3b16d49c10fc9834f32009095d35c9c55a8..1f8b7b50c6aa24778d87821ae2ff4d019d176082 100644 +index 68a8d3b16d49c10fc9834f32009095d35c9c55a8..f0b720eafc538f97d788f89bd2f2e9da0ff84a19 100644 --- a/src/main/java/net/minecraft/world/item/HoneycombItem.java +++ b/src/main/java/net/minecraft/world/item/HoneycombItem.java -@@ -37,6 +37,11 @@ public class HoneycombItem extends Item { +@@ -37,6 +37,14 @@ public class HoneycombItem extends Item { return getWaxed(blockState).map((state) -> { Player player = context.getPlayer(); ItemStack itemStack = context.getItemInHand(); + // Paper start - EntityChangeBlockEvent + if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, blockPos, state).isCancelled()) { ++ if (!player.isCreative()) { ++ player.containerMenu.sendAllDataToRemote(); ++ } + return InteractionResult.PASS; + } + // Paper end