mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 02:02:04 -07:00
uuid changes
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.List;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public class WorldData {
|
||||
|
||||
@@ -20,7 +19,6 @@ public class WorldData {
|
||||
private int m;
|
||||
private boolean n;
|
||||
private int o;
|
||||
private long worldUID; // CraftBukkit
|
||||
|
||||
public WorldData(NBTTagCompound nbttagcompound) {
|
||||
this.a = nbttagcompound.getLong("RandomSeed");
|
||||
@@ -40,24 +38,11 @@ public class WorldData {
|
||||
this.h = nbttagcompound.k("Player");
|
||||
this.i = this.h.e("Dimension");
|
||||
}
|
||||
// CraftBukkit start
|
||||
if (nbttagcompound.hasKey("WorldUID")) {
|
||||
this.worldUID = nbttagcompound.getLong("WorldUID");
|
||||
} else {
|
||||
this.worldUID = (System.nanoTime() << 20) + this.a;
|
||||
nbttagcompound.setLong("WorldUID", this.worldUID);
|
||||
}
|
||||
|
||||
if (Bukkit.getServer().getWorld(worldUID) != null) {
|
||||
throw new IllegalStateException("World '" + name + "' contains a conflicting UID with existing world. Please edit its level.dat and remove WorldUID, or delete its level.dat (and lose its seed/etc).");
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public WorldData(long i, String s) {
|
||||
this.a = i;
|
||||
this.name = s;
|
||||
this.worldUID = (System.nanoTime() << 20) + this.a; // CraftBukkit
|
||||
}
|
||||
|
||||
public WorldData(WorldData worlddata) {
|
||||
@@ -120,7 +105,6 @@ public class WorldData {
|
||||
if (nbttagcompound1 != null) {
|
||||
nbttagcompound.a("Player", nbttagcompound1);
|
||||
}
|
||||
nbttagcompound.setLong("WorldUID", this.worldUID); // CraftBukkit
|
||||
}
|
||||
|
||||
public long getSeed() {
|
||||
@@ -208,10 +192,4 @@ public class WorldData {
|
||||
public void setWeatherDuration(int i) {
|
||||
this.m = i;
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
public long getWorldUID() {
|
||||
return this.worldUID;
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
Reference in New Issue
Block a user