2022-03-02 10:21:30 +01:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2022-08-01 16:01:20 +02:00
From: Nassim Jahnke <nassim@njahnke.dev>
2022-03-02 10:21:30 +01:00
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
2024-10-27 20:09:27 +01:00
index bb301d1ce9c1792ead2681c9f3d38bb2079b0112..11f86e1b119d20f668e67b83f09137dcb24d4bf1 100644
2022-03-02 10:21:30 +01:00
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
2024-10-27 18:11:15 +01:00
@@ -406,6 +406,16 @@ public abstract class PlayerList {
2024-10-23 23:12:09 +02:00
}
// Paper end - Configurable player collision
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
2022-06-08 19:50:57 +02:00
+ // 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()) {
2024-10-23 23:12:09 +02:00
+ net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> plains = worldserver1.registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME)
2024-10-25 13:52:04 +02:00
+ .getOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS);
2022-06-08 19:50:57 +02:00
+ player.connection.send(new net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket(
2024-10-23 23:12:09 +02:00
+ new net.minecraft.world.level.chunk.EmptyLevelChunk(worldserver1, player.chunkPosition(), plains),
+ worldserver1.getLightEngine(), (java.util.BitSet)null, (java.util.BitSet) null)
2022-06-08 19:50:57 +02:00
+ );
+ }
2024-01-18 18:52:00 +01:00
+ // Paper end - Send empty chunk
2022-03-02 10:21:30 +01:00
}
2024-10-23 22:52:43 +02:00
2024-10-23 23:12:09 +02:00
public void updateEntireScoreboard(ServerScoreboard scoreboard, ServerPlayer player) {