Add setSpawnLocation(Location)

This commit is contained in:
Cory Redmond 2016-07-11 02:20:23 +01:00 committed by md_5
parent 6e0b0a1b55
commit 74cd5fdfc4

View File

@ -112,6 +112,13 @@ public class CraftWorld implements World {
return new Location(this, spawn.getX(), spawn.getY(), spawn.getZ());
}
@Override
public boolean setSpawnLocation(Location location) {
Preconditions.checkArgument(location != null, "location");
return equals(location.getWorld()) ? setSpawnLocation(location.getBlockX(), location.getBlockY(), location.getBlockZ()) : false;
}
public boolean setSpawnLocation(int x, int y, int z) {
try {
Location previousLocation = getSpawnLocation();