Improve async login (#3189)
Add helper functions to ChunkProviderServer to make this easier for other uses Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Load Chunks for Login Asynchronously
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index e737381b3..83ceb3f99 100644
|
||||
index c2850d50d..d145c4bf1 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
@@ -25,7 +25,7 @@ index e737381b3..83ceb3f99 100644
|
||||
|
||||
+ // Paper start - async load spawn in chunk
|
||||
+ WorldServer finalWorldserver = worldserver;
|
||||
+ worldserver.getChunkProvider().getChunkAtAsynchronously(loc.getBlockX() >> 4, loc.getBlockZ() >> 4, true, (chunk -> {
|
||||
+ worldserver.getChunkProvider().getTickingChunkAsync(loc.getBlockX() >> 4, loc.getBlockZ() >> 4, (chunk -> { // use ticking - as it has at least 1 neighbours loaded
|
||||
+ if (networkmanager.isConnected()) {
|
||||
+ postChunkLoadJoin(entityplayer, finalWorldserver, nbttagcompound, networkmanager, lastKnownName, networkmanager.getSocketAddress().toString());
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user