mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-22 08:15:05 +01:00
Map handling improvements.
Fixed an NPE occurring under certain circumstances. Made it possible for maps to exist without having to associate them with a world.
This commit is contained in:
parent
ae43b837b0
commit
bb89847632
1 changed files with 16 additions and 11 deletions
|
@ -45,7 +45,7 @@ public class WorldMap extends WorldMapBase {
|
|||
|
||||
if (least != 0L && most != 0L) {
|
||||
this.uniqueId = new UUID(most, least);
|
||||
}
|
||||
|
||||
CraftWorld world = (CraftWorld) server.getWorld(this.uniqueId);
|
||||
// Check if the stored world details are correct.
|
||||
if (world == null) {
|
||||
|
@ -56,6 +56,7 @@ public class WorldMap extends WorldMapBase {
|
|||
dimension = (byte) world.getHandle().dimension;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.map = dimension;
|
||||
// CraftBukkit end
|
||||
|
@ -110,9 +111,13 @@ public class WorldMap extends WorldMapBase {
|
|||
}
|
||||
}
|
||||
}
|
||||
/* Perform a second check to see if a matching world was found, this is a necessary
|
||||
change incase Maps are forcefully unlinked from a World and lack a UID.*/
|
||||
if (this.uniqueId != null) {
|
||||
nbttagcompound.setLong("UUIDLeast", this.uniqueId.getLeastSignificantBits());
|
||||
nbttagcompound.setLong("UUIDMost", this.uniqueId.getMostSignificantBits());
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
nbttagcompound.a("dimension", this.map);
|
||||
nbttagcompound.a("xCenter", this.b);
|
||||
|
|
Loading…
Add table
Reference in a new issue