3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00

Fix inventory desync with PlayerLeashEntityEvent (#10436)

Dieser Commit ist enthalten in:
Tamion 2024-04-20 05:23:32 +02:00 committet von GitHub
Ursprung 3b078f822a
Commit 908b8141c9
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
2 geänderte Dateien mit 14 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -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

Datei anzeigen

@ -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) {