diff options
author | Nassim Jahnke <[email protected]> | 2022-03-02 10:21:30 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2022-03-02 10:21:30 +0100 |
commit | b1afebbd52e1c8ca33edac09fcb72164e843f692 (patch) | |
tree | 5844680598bdf6eac09c3005f58cab129ed4b649 | |
parent | 178802ab94714d68c0833f53fbc9de0764ab0f8b (diff) | |
download | Paper-b1afebbd52e1c8ca33edac09fcb72164e843f692.tar.gz Paper-b1afebbd52e1c8ca33edac09fcb72164e843f692.zip |
Force close world loading screen on join (#7529)
Fixes infinite loading screens for dead players due to async chunk loading and player chunk loading patches and prevents players from missing messages and similar if chunk loading is slow
-rw-r--r-- | patches/server/0877-Force-close-world-loading-screen.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/patches/server/0877-Force-close-world-loading-screen.patch b/patches/server/0877-Force-close-world-loading-screen.patch new file mode 100644 index 0000000000..24a6fd821f --- /dev/null +++ b/patches/server/0877-Force-close-world-loading-screen.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nassim Jahnke <[email protected]> +Date: Wed, 2 Mar 2022 09:45:56 +0100 +Subject: [PATCH] Force close world loading screen + +Dead players would be stuck in the world loading screen and other players may +miss messages and similar sent in the join event if chunk loading is slow. +Paper already circumvents falling through the world before chunks are loaded, +so we do not need that. The client only needs the chunk it is currently in to +be loaded to close the loading screen, so we just send an empty one. + +diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java +index f5852341161b0d632e22af9b3e625ca1e786bd63..02dc93c394d37c9a84aa4a58d80615c403c54fb9 100644 +--- a/src/main/java/net/minecraft/server/players/PlayerList.java ++++ b/src/main/java/net/minecraft/server/players/PlayerList.java +@@ -422,6 +422,13 @@ public abstract class PlayerList { + + // Paper start - move vehicle into method so it can be called above - short circuit around that code + onPlayerJoinFinish(player, worldserver1, s1); ++ // Send empty chunk, so players aren't stuck in the world loading screen ++ net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> plains = worldserver1.registryAccess().registryOrThrow(net.minecraft.core.Registry.BIOME_REGISTRY) ++ .getHolderOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS); ++ player.connection.send(new net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket( ++ new net.minecraft.world.level.chunk.EmptyLevelChunk(worldserver1, player.chunkPosition(), plains), ++ worldserver1.getLightEngine(), null, null, true, false) ++ ); + } + private void mountSavedVehicle(ServerPlayer player, ServerLevel worldserver1, CompoundTag nbttagcompound) { + // Paper end |