Fix UUID not being updated when changing world of MapView
By: Phoenix616 <max@themoep.de>
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ public final CraftMapView mapView;
|
+ public final CraftMapView mapView;
|
||||||
+ private CraftServer server;
|
+ private CraftServer server;
|
||||||
+ private UUID uniqueId = null;
|
+ public UUID uniqueId = null;
|
||||||
+ public String id;
|
+ public String id;
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
+
|
+
|
||||||
|
|||||||
@@ -64,12 +64,20 @@ public final class CraftMapView implements MapView {
|
|||||||
ResourceKey<net.minecraft.world.level.World> dimension = worldMap.dimension;
|
ResourceKey<net.minecraft.world.level.World> dimension = worldMap.dimension;
|
||||||
WorldServer world = MinecraftServer.getServer().getLevel(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
|
@Override
|
||||||
public void setWorld(World world) {
|
public void setWorld(World world) {
|
||||||
worldMap.dimension = ((CraftWorld) world).getHandle().dimension();
|
worldMap.dimension = ((CraftWorld) world).getHandle().dimension();
|
||||||
|
worldMap.uniqueId = world.getUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user