From c83700291ac249e2426ba1129a810f0c6c8ba1a4 Mon Sep 17 00:00:00 2001 From: LemonCaramel Date: Mon, 6 Dec 2021 04:44:17 +0900 Subject: [PATCH] Fix client world difficulty sync issue (#7035) --- ...er-World-Difficulty-Remembering-Difficulty.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/patches/server/0453-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0453-Fix-Per-World-Difficulty-Remembering-Difficulty.patch index 06d917f25..f5d589f9c 100644 --- a/patches/server/0453-Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/patches/server/0453-Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -80,6 +80,19 @@ index 2b7ba5d8dda0297c8b35a0cea68c3ae10188e3f2..e968b880e435b8753314d85b919a0abc } @Override +diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java +index 2f13055a39c26fe12d2c1094103186635e536166..6b0cb662d9163c360035e19c5faad59fc72af3c1 100644 +--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java ++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +@@ -1116,7 +1116,7 @@ public class ServerPlayer extends Player { + this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds + + this.connection.send(new ClientboundRespawnPacket(worldserver.dimensionType(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), this.gameMode.getGameModeForPlayer(), this.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), true)); +- this.connection.send(new ClientboundChangeDifficultyPacket(this.level.getDifficulty(), this.level.getLevelData().isDifficultyLocked())); ++ this.connection.send(new ClientboundChangeDifficultyPacket(worldserver.getDifficulty(), worldserver.getLevelData().isDifficultyLocked())); // Paper - fix difficulty sync issue + PlayerList playerlist = this.server.getPlayerList(); + + playerlist.sendPlayerPermissionLevel(this); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java index 22a10327a690263a8756ffa3098b816c4be20e54..4e73fae8276be9874c61a456a2648828d39dd1cb 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java