diff --git a/patches/server/0376-Implement-Player-Client-Options-API.patch b/patches/server/0376-Implement-Player-Client-Options-API.patch index 3670427b7c..b6945da92d 100644 --- a/patches/server/0376-Implement-Player-Client-Options-API.patch +++ b/patches/server/0376-Implement-Player-Client-Options-API.patch @@ -87,9 +87,18 @@ index 0000000000000000000000000000000000000000..b6f4400df3d8ec7e06a996de54f8cabb + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 0bab5208a38e8e7c848e9162396df535eb7e5711..baec871645598c36cefda7478e91b560bdfdf6fe 100644 +index 0bab5208a38e8e7c848e9162396df535eb7e5711..88fcf595c6a28811545715f5e5a225809a977d76 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +@@ -379,7 +379,7 @@ public class ServerPlayer extends Player { + this.advancements = server.getPlayerList().getPlayerAdvancements(this); + this.setMaxUpStep(1.0F); + // this.fudgeSpawnLocation(world); // Paper - don't move to spawn on login, only first join +- this.updateOptions(clientOptions); ++ this.updateOptionsNoEvents(clientOptions); // Paper - don't call options events on login + + this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper + @@ -1950,7 +1950,23 @@ public class ServerPlayer extends Player { } } @@ -114,6 +123,18 @@ index 0bab5208a38e8e7c848e9162396df535eb7e5711..baec871645598c36cefda7478e91b560 // CraftBukkit start if (getMainArm() != clientOptions.mainHand()) { PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT); +@@ -1962,6 +1978,11 @@ public class ServerPlayer extends Player { + this.server.server.getPluginManager().callEvent(new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), this.language, clientOptions.language())); // Paper + } + // CraftBukkit end ++ // Paper start - don't call options events on login ++ updateOptionsNoEvents(clientOptions); ++ } ++ public void updateOptionsNoEvents(ClientInformation clientOptions) { ++ // Paper end + this.language = clientOptions.language(); + this.adventure$locale = net.kyori.adventure.translation.Translator.parseLocale(this.language); // Paper + this.requestedViewDistance = clientOptions.viewDistance(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 94cb3513aeef549da3626ff18c1ea0662252ecb9..f4a15de92c3af88624f337c36fadbea67d339064 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/patches/server/0599-additions-to-PlayerGameModeChangeEvent.patch b/patches/server/0599-additions-to-PlayerGameModeChangeEvent.patch index 5890feb1eb..aaa9ccb441 100644 --- a/patches/server/0599-additions-to-PlayerGameModeChangeEvent.patch +++ b/patches/server/0599-additions-to-PlayerGameModeChangeEvent.patch @@ -45,7 +45,7 @@ index aee8618e27b893b72931e925724dd683d2e6d2aa..5cb15e2209d7b315904a1fc6d650ce1e } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index d942b68c01b202dcad1377e98199bab2f79feebf..6856080fc6195e5f340d64434955c4ea3f0b0ef8 100644 +index 1d7fe0e7d382d2f2aa5a38732cc6212d6c7a11e3..e12e512b607882f68b6f32b6201aeb2b3e39a699 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1887,8 +1887,16 @@ public class ServerPlayer extends Player { @@ -76,7 +76,7 @@ index d942b68c01b202dcad1377e98199bab2f79feebf..6856080fc6195e5f340d64434955c4ea } } -@@ -2304,6 +2312,16 @@ public class ServerPlayer extends Player { +@@ -2309,6 +2317,16 @@ public class ServerPlayer extends Player { } public void loadGameTypes(@Nullable CompoundTag nbt) { diff --git a/patches/server/0626-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0626-Fix-PlayerDropItemEvent-using-wrong-item.patch index 570df3d4a1..119470aad4 100644 --- a/patches/server/0626-Fix-PlayerDropItemEvent-using-wrong-item.patch +++ b/patches/server/0626-Fix-PlayerDropItemEvent-using-wrong-item.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix PlayerDropItemEvent using wrong item diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 6856080fc6195e5f340d64434955c4ea3f0b0ef8..ec135dca185c0c9cdb5a28c75d44f54681448cf8 100644 +index e12e512b607882f68b6f32b6201aeb2b3e39a699..963af930dc40b30d84c1e5d46be752ef74908a8a 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2281,7 +2281,7 @@ public class ServerPlayer extends Player { +@@ -2286,7 +2286,7 @@ public class ServerPlayer extends Player { if (retainOwnership) { if (!itemstack1.isEmpty()) { diff --git a/patches/server/0646-Add-PlayerSetSpawnEvent.patch b/patches/server/0646-Add-PlayerSetSpawnEvent.patch index 519983df6d..7374ed9828 100644 --- a/patches/server/0646-Add-PlayerSetSpawnEvent.patch +++ b/patches/server/0646-Add-PlayerSetSpawnEvent.patch @@ -49,7 +49,7 @@ index a2d0699e8427b2262a2396495111125eccafbb66..d797637f61bdf8a424f56fbb48e28b7c } } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 25f6b4e7ac794431f1b6170e9e680e43c44d10cf..f612363c1530dd66fd57eaa324e285d481fa30e6 100644 +index 47e7bc46d349e0f0000676948a5c251f555abeb1..6b92189b6dddee7e632c142430eaa784d22adbca 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1351,7 +1351,7 @@ public class ServerPlayer extends Player { @@ -61,7 +61,7 @@ index 25f6b4e7ac794431f1b6170e9e680e43c44d10cf..f612363c1530dd66fd57eaa324e285d4 if (this.level().isDay()) { return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_NOW); } else { -@@ -2201,44 +2201,50 @@ public class ServerPlayer extends Player { +@@ -2206,44 +2206,50 @@ public class ServerPlayer extends Player { return this.respawnForced; } @@ -145,7 +145,7 @@ index 25f6b4e7ac794431f1b6170e9e680e43c44d10cf..f612363c1530dd66fd57eaa324e285d4 } else { this.respawnPosition = null; this.respawnDimension = Level.OVERWORLD; -@@ -2246,6 +2252,7 @@ public class ServerPlayer extends Player { +@@ -2251,6 +2257,7 @@ public class ServerPlayer extends Player { this.respawnForced = false; }