Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
notTamion committed Jul 16, 2024
1 parent ef96a69 commit fc7091e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions patches/server/0880-Fix-inventory-desync.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@ index ccb4cbb28fc9c565571e1f9da2bf459cec25d36c..b5035cc4b5cfa246487dc5091cc5d43e
public void resendItemInHands() {
this.containerMenu.findSlot(this.getInventory(), this.getInventory().selected).ifPresent(s -> {
this.containerSynchronizer.sendSlotChange(this.containerMenu, s, this.getMainHandItem());
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 0ed03a8ec85d8491d96c7b3ac3feff805a773539..5296155cb512ffd85ab95691d57d1bb0a8e38153 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1867,7 +1867,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} else if (enuminteractionresult.shouldSwing() && !this.player.gameMode.interactResult) { // Paper - Call interact event
this.player.swing(enumhand, true);
}
- }
+ } else { this.player.containerMenu.sendAllDataToRemote(); } // Paper - Fix inventory desync
} else {
MutableComponent ichatmutablecomponent1 = Component.translatable("build.tooHigh", i - 1).withStyle(ChatFormatting.RED);

diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 80a29f4818cda4255c82fcd47f0da2235a02da23..23442e0f887cec3c3a65b3dd3d0f4f40db0e54b1 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
Expand Down

0 comments on commit fc7091e

Please sign in to comment.