From 4fd17445297b41e7121303bf886b32192346e715 Mon Sep 17 00:00:00 2001 From: Wyatt Childers Date: Fri, 3 Jul 2020 14:57:28 -0400 Subject: [PATCH] Spawn player in correct world on login --- ...awn-player-in-correct-world-on-login.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Spigot-Server-Patches/0532-Spawn-player-in-correct-world-on-login.patch diff --git a/Spigot-Server-Patches/0532-Spawn-player-in-correct-world-on-login.patch b/Spigot-Server-Patches/0532-Spawn-player-in-correct-world-on-login.patch new file mode 100644 index 000000000..588f4781c --- /dev/null +++ b/Spigot-Server-Patches/0532-Spawn-player-in-correct-world-on-login.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Wyatt Childers +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 f17399a73e0de49d2e7325747a2637f447df78f2..3c2f1f140c3991195bb8147bd65d9cd16a8fd3da 100644 +--- a/src/main/java/net/minecraft/server/PlayerList.java ++++ b/src/main/java/net/minecraft/server/PlayerList.java +@@ -119,7 +119,18 @@ 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; +