2021-06-11 14:02:28 +02:00
|
|
|
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/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2021-11-26 17:25:35 +01:00
|
|
|
index a40ca089d92df8f3ea0a444e3293531e787b196b..ed4e13528cf0fe48384efcb3f55cb5149f4cf681 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2021-07-07 08:52:40 +02:00
|
|
|
@@ -196,7 +196,18 @@ public abstract class PlayerList {
|
2021-06-11 14:02:28 +02:00
|
|
|
}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.contains("WorldUUIDMost") && nbttagcompound.contains("WorldUUIDLeast")) {
|
|
|
|
+ UUID uid = new UUID(nbttagcompound.getLong("WorldUUIDMost"), nbttagcompound.getLong("WorldUUIDLeast"));
|
|
|
|
+ org.bukkit.World bWorld = org.bukkit.Bukkit.getServer().getWorld(uid);
|
|
|
|
+ if (bWorld != null) {
|
|
|
|
+ resourcekey = ((CraftWorld) bWorld).getHandle().dimension();
|
|
|
|
+ } else {
|
|
|
|
+ resourcekey = Level.OVERWORLD;
|
|
|
|
+ }
|
|
|
|
+ } else if (nbttagcompound != null) {
|
|
|
|
+ // Vanilla migration support
|
|
|
|
+ // Paper end
|
|
|
|
DataResult dataresult = DimensionType.parseLegacy(new Dynamic(NbtOps.INSTANCE, nbttagcompound.get("Dimension")));
|
|
|
|
Logger logger = PlayerList.LOGGER;
|
|
|
|
|