3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/Spigot-Server-Patches/0526-Spawn-player-in-correct-world-on-login.patch
Mariell Hoversholm 654b792caf Updated Upstream (CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
a339310c #755: Fix NPE when calling getInventory() for virtual EnderChests
2577f9bf Increase outdated build delay
1dabfdc8 #754: Fix pre-1.16 serialized SkullMeta being broken on 1.16+, losing textures
2020-09-27 11:04:51 -04:00

31 Zeilen
1.6 KiB
Diff

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 3e11c9ca6efde2347a963177f325b1efa67eb4f8..3a38e3fc1f59cee5505c6ad7174c7014ec8efc25 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;