2022-03-02 09:21:30 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2022-08-01 14:01:20 +00:00
|
|
|
From: Nassim Jahnke <nassim@njahnke.dev>
|
2022-03-02 09:21:30 +00: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
|
2022-11-03 21:03:31 +00:00
|
|
|
index 10a4b9b2a954fc5d86ebf3f643cdc940911e7693..4fe2184223568a6d8b800e83faa9ade1bba7d31f 100644
|
2022-03-02 09:21:30 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2022-09-01 16:51:59 +00:00
|
|
|
@@ -429,6 +429,16 @@ public abstract class PlayerList {
|
2022-03-02 09:21:30 +00:00
|
|
|
|
|
|
|
// Paper start - move vehicle into method so it can be called above - short circuit around that code
|
|
|
|
onPlayerJoinFinish(player, worldserver1, s1);
|
2022-06-08 17:50:57 +00: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()) {
|
|
|
|
+ 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)
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
2022-03-02 09:21:30 +00:00
|
|
|
}
|
|
|
|
private void mountSavedVehicle(ServerPlayer player, ServerLevel worldserver1, CompoundTag nbttagcompound) {
|
|
|
|
// Paper end
|