mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 02:22:12 +01:00
Implements a World UID.
By: Rigby <rigby@onarandombox.com>
This commit is contained in:
parent
ae08c5c5ec
commit
860f6ad4b7
2 changed files with 15 additions and 0 deletions
|
@ -490,6 +490,16 @@ public final class CraftServer implements Server {
|
|||
return worlds.get(name.toLowerCase());
|
||||
}
|
||||
|
||||
public World getWorld(long uid) {
|
||||
for (String worldName : worlds.keySet()) {
|
||||
org.bukkit.World world = worlds.get(worldName);
|
||||
if (world.getUID() == uid) {
|
||||
return world;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addWorld(World world) {
|
||||
worlds.put(world.getName().toLowerCase(), world);
|
||||
}
|
||||
|
|
|
@ -395,10 +395,15 @@ public class CraftWorld implements World {
|
|||
return world.worldData.name;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public long getId() {
|
||||
return world.worldData.getSeed();
|
||||
}
|
||||
|
||||
public long getUID() {
|
||||
return world.worldData.getWorldUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CraftWorld{name=" + getName() + '}';
|
||||
|
|
Loading…
Reference in a new issue