From 39333c8c382e50e94cb48bedcc2db744dc5da967 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 8 Jun 2022 19:50:57 +0200 Subject: [PATCH] Only send empty chunk when player is dead Currently not needed at all with chunk rewrites not yet updated, but considering it's only actually needed for dead players, no need to fuck up a chunk without the future applied patch --- .../Force-close-world-loading-screen.patch | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/patches/server/Force-close-world-loading-screen.patch b/patches/server/Force-close-world-loading-screen.patch index 90d71cb431..4b7425d5c8 100644 --- a/patches/server/Force-close-world-loading-screen.patch +++ b/patches/server/Force-close-world-loading-screen.patch @@ -17,13 +17,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // 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 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) -+ ); ++ // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead ++ if (player.isDeadOrDying()) { ++ net.minecraft.core.Holder 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) ++ ); ++ } ++ // Paper end } private void mountSavedVehicle(ServerPlayer player, ServerLevel worldserver1, CompoundTag nbttagcompound) { // Paper end