From 74cd5fdfc43cadbfd6b55de344fa67675e2437b1 Mon Sep 17 00:00:00 2001 From: Cory Redmond Date: Mon, 11 Jul 2016 02:20:23 +0100 Subject: [PATCH] Add setSpawnLocation(Location) --- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 1941e3a20f..8f6653f773 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -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();