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
|
2023-05-12 13:10:08 +02:00
|
|
|
index 44ead3a9831d913f7337a447b73a94e06fb0f06a..ff5f15fef219b4ce5907b7eb8a489fc5c09d55ba 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
|
2023-05-12 13:10:08 +02:00
|
|
|
@@ -205,7 +205,18 @@ public abstract class PlayerList {
|
2022-12-19 11:46:55 +01:00
|
|
|
}
|
2021-06-11 14:02:28 +02:00
|
|
|
// 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
|
2022-03-01 06:43:03 +01:00
|
|
|
DataResult<ResourceKey<Level>> dataresult = DimensionType.parseLegacy(new Dynamic(NbtOps.INSTANCE, nbttagcompound.get("Dimension"))); // CraftBukkit - decompile error
|
2021-06-11 14:02:28 +02:00
|
|
|
Logger logger = PlayerList.LOGGER;
|
|
|
|
|