diff options
author | Tamion <[email protected]> | 2024-04-20 05:23:32 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-04-19 20:23:32 -0700 |
commit | 908b8141c9100989f71747e357e82416d8e3b08f (patch) | |
tree | 61ec49fb4543328b415b2a7ba3f3e6f56acb38fd | |
parent | 3b078f822a46039edbf8f9bdf078b28e35b57ca2 (diff) | |
download | Paper-908b8141c9100989f71747e357e82416d8e3b08f.tar.gz Paper-908b8141c9100989f71747e357e82416d8e3b08f.zip |
Fix inventory desync with PlayerLeashEntityEvent (#10436)
-rw-r--r-- | patches/server/0926-Fix-inventory-desync.patch | 12 | ||||
-rw-r--r-- | patches/server/0972-Add-PlayerShieldDisableEvent.patch | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/patches/server/0926-Fix-inventory-desync.patch b/patches/server/0926-Fix-inventory-desync.patch index 4345fa9aa5..f69c4d7ee9 100644 --- a/patches/server/0926-Fix-inventory-desync.patch +++ b/patches/server/0926-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 d1833dcc92b1570e62a1941bbea6d66ff0b2ee5f..5da7ffee71bf6d82a53b3c2f99e2bd898d0b1799 100644 +--- a/src/main/java/net/minecraft/world/entity/Mob.java ++++ b/src/main/java/net/minecraft/world/entity/Mob.java +@@ -1336,6 +1336,7 @@ 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 e258e5915b286f1117bc1413dfd3d2a5c4655380..8d2c0accadaf0c5d28e7db6e62a05f6c619cf02f 100644 --- a/src/main/java/net/minecraft/world/item/BlockItem.java diff --git a/patches/server/0972-Add-PlayerShieldDisableEvent.patch b/patches/server/0972-Add-PlayerShieldDisableEvent.patch index a02011827d..196eafaea2 100644 --- a/patches/server/0972-Add-PlayerShieldDisableEvent.patch +++ b/patches/server/0972-Add-PlayerShieldDisableEvent.patch @@ -16,10 +16,10 @@ sideeffects, meaning the disable event cannot share a handlerlist with the cooldown event diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 4e8aee81cb9e9fe4a4e5df4e228c0314b3af486b..544e22f569d7ddeb1ba46a9ef7f4d4d6ca37c431 100644 +index a59ee9d9b93404060e7a4702497071859daec6df..f7818fd5e59784554732c39ef5c56461ea0d62c4 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -1698,7 +1698,11 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1699,7 +1699,11 @@ public abstract class Mob extends LivingEntity implements Targeting { float f = 0.25F + (float) EnchantmentHelper.getBlockEfficiency(this) * 0.05F; if (this.random.nextFloat() < f) { |