Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
33 Zeilen
2.2 KiB
Diff
33 Zeilen
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Nassim Jahnke <nassim@njahnke.dev>
|
|
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 bb301d1ce9c1792ead2681c9f3d38bb2079b0112..11f86e1b119d20f668e67b83f09137dcb24d4bf1 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -406,6 +406,16 @@ public abstract class PlayerList {
|
|
}
|
|
// 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());
|
|
+ // 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().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME)
|
|
+ .getOrThrow(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(), (java.util.BitSet)null, (java.util.BitSet) null)
|
|
+ );
|
|
+ }
|
|
+ // Paper end - Send empty chunk
|
|
}
|
|
|
|
public void updateEntireScoreboard(ServerScoreboard scoreboard, ServerPlayer player) {
|