mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-22 07:43:49 -07:00
Spawn player in correct world on login
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Wyatt Childers <wchilders@nearce.com>
|
||||||
|
Date: Fri, 3 Jul 2020 14:57:05 -0400
|
||||||
|
Subject: [PATCH] Spawn player in correct world on login
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 {
|
||||||
|
}String lastKnownName = s; // Paper
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
|
- if (nbttagcompound != null) {
|
||||||
|
+ // Paper start - move logic in Entity to here, to use bukkit supplied world UUID.
|
||||||
|
+ if (nbttagcompound != null && nbttagcompound.hasKey("WorldUUIDMost") && nbttagcompound.hasKey("WorldUUIDLeast")) {
|
||||||
|
+ UUID uid = new UUID(nbttagcompound.getLong("WorldUUIDMost"), nbttagcompound.getLong("WorldUUIDLeast"));
|
||||||
|
+ org.bukkit.World bWorld = Bukkit.getServer().getWorld(uid);
|
||||||
|
+ if (bWorld != null) {
|
||||||
|
+ resourcekey = ((CraftWorld) bWorld).getHandle().getDimensionKey();
|
||||||
|
+ } else {
|
||||||
|
+ resourcekey = World.OVERWORLD;
|
||||||
|
+ }
|
||||||
|
+ } else if (nbttagcompound != null) {
|
||||||
|
+ // Vanilla migration support
|
||||||
|
+ // Paper end
|
||||||
|
DataResult dataresult = DimensionManager.a(new Dynamic(DynamicOpsNBT.a, nbttagcompound.get("Dimension")));
|
||||||
|
Logger logger = PlayerList.LOGGER;
|
||||||
|
|
Reference in New Issue
Block a user