From b1a467786e3a267796cdfd2f328001f9a411c016 Mon Sep 17 00:00:00 2001 From: Tamion <70228790+notTamion@users.noreply.github.com> Date: Sat, 20 Apr 2024 05:23:32 +0200 Subject: [PATCH] Fix inventory desync with PlayerLeashEntityEvent (#10436) --- patches/server/Fix-inventory-desync.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patches/server/Fix-inventory-desync.patch b/patches/server/Fix-inventory-desync.patch index cba2f36348..14c9bd7363 100644 --- a/patches/server/Fix-inventory-desync.patch +++ b/patches/server/Fix-inventory-desync.patch @@ -4,6 +4,18 @@ Date: Wed, 23 Aug 2023 13:22:09 -0700 Subject: [PATCH] Fix inventory desync +diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/Mob.java ++++ b/src/main/java/net/minecraft/world/entity/Mob.java +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { + // CraftBukkit start - fire PlayerLeashEntityEvent + if (CraftEventFactory.callPlayerLeashEntityEvent(this, player, player, hand).isCancelled()) { + ((ServerPlayer) player).connection.send(new ClientboundSetEntityLinkPacket(this, this.getLeashHolder())); ++ player.containerMenu.sendAllDataToRemote(); // Paper - Fix inventory desync + return InteractionResult.PASS; + } + // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/BlockItem.java