mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-09 09:01:36 +01:00
Fix UUID not being updated when changing world of MapView
By: Phoenix616 <max@themoep.de>
This commit is contained in:
parent
7b627056c1
commit
48dd61052b
@ -24,7 +24,7 @@
|
||||
+ // CraftBukkit start
|
||||
+ public final CraftMapView mapView;
|
||||
+ private CraftServer server;
|
||||
+ private UUID uniqueId = null;
|
||||
+ public UUID uniqueId = null;
|
||||
+ public String id;
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
|
@ -64,12 +64,20 @@ public final class CraftMapView implements MapView {
|
||||
ResourceKey<net.minecraft.world.level.World> dimension = worldMap.dimension;
|
||||
WorldServer world = MinecraftServer.getServer().getLevel(dimension);
|
||||
|
||||
return (world == null) ? null : world.getWorld();
|
||||
if (world != null) {
|
||||
return world.getWorld();
|
||||
}
|
||||
|
||||
if (worldMap.uniqueId != null) {
|
||||
return Bukkit.getServer().getWorld(worldMap.uniqueId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWorld(World world) {
|
||||
worldMap.dimension = ((CraftWorld) world).getHandle().dimension();
|
||||
worldMap.uniqueId = world.getUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user