aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTamion <[email protected]>2024-08-31 21:01:29 +0200
committerGitHub <[email protected]>2024-08-31 12:01:29 -0700
commit227c94ae21634e3cba5992ac29bb2b258f039067 (patch)
treec9ae0978085078a76a667b5f299b3f9add36b207
parent2f0891ed81705200a4b7dfa76850eac02e75dade (diff)
downloadPaper-227c94ae21634e3cba5992ac29bb2b258f039067.tar.gz
Paper-227c94ae21634e3cba5992ac29bb2b258f039067.zip
Fix inventory desync when placing blocks with spawn protection (#11090)
* fix * mention mojira issue * move to vanilla bug fixes patch --------- Co-authored-by: Jake Potrebic <[email protected]>
-rw-r--r--patches/server/0748-Fix-a-bunch-of-vanilla-bugs.patch16
-rw-r--r--patches/server/0877-Fix-slot-desync.patch2
2 files changed, 17 insertions, 1 deletions
diff --git a/patches/server/0748-Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/0748-Fix-a-bunch-of-vanilla-bugs.patch
index 42c78ff9fa..8bac2e9b94 100644
--- a/patches/server/0748-Fix-a-bunch-of-vanilla-bugs.patch
+++ b/patches/server/0748-Fix-a-bunch-of-vanilla-bugs.patch
@@ -52,6 +52,9 @@ https://bugs.mojang.com/browse/MC-200092
https://bugs.mojang.com/browse/MC-158900
Fix error when joining after tempban expired
+https://bugs.mojang.com/browse/MC-99075
+ Fix inventory desync within spawn protected area
+
== AT ==
public net/minecraft/world/entity/Mob leashInfoTag
@@ -123,6 +126,19 @@ index 6abecaac8407b992d208a9108e11fd4954a4106f..03d89f326d320c5d778c3d1e2db7d6b8
this.player.onUpdateAbilities();
this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit
this.level.updateSleepingPlayerList();
+diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+index ca32e5aa6e77ca1bab886e7b6a778ec931ac4e4c..28808ffc6e486f7dc01be370c9eb249dc1f7ea46 100644
+--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+@@ -1814,7 +1814,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; MC-99075
+ } else {
+ MutableComponent ichatmutablecomponent1 = Component.translatable("build.tooHigh", i - 1).withStyle(ChatFormatting.RED);
+
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index be842c81ae6c6ec64a233f126d7221a37d66439c..b54e8da2209d99696e12c65a23323a68b7da272b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
diff --git a/patches/server/0877-Fix-slot-desync.patch b/patches/server/0877-Fix-slot-desync.patch
index 17d0c4b2c9..aa5a024985 100644
--- a/patches/server/0877-Fix-slot-desync.patch
+++ b/patches/server/0877-Fix-slot-desync.patch
@@ -22,7 +22,7 @@ index 7270b6fa96bae937663c0fea77887e21fbd0eb57..530728cd4b258444f6efe064903b521f
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 adf9357363465fd7a8c9e0d51b80b9f61d531a01..5541de6364b9982ae95e0a952167ae09084f65cf 100644
+index be0ce72bb493593a3d2eb7d7c37e3a650b7cc34b..0ffa95542a0ed49a3f83700841f7c76c0717ae22 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2729,10 +2729,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl