diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fcf52e..53a85e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +# Beta 32.1 +**REQUIRED: Sponge API 7.3+; Grief Defender 2+; LuckPerms 5.3.X;** +**OPTIONAL: Nucleus 2.3.2+** +- Bug Fix: `World -> Spawn-World` config option works as intended again + # Beta 32 - Grief Defender 2 **REQUIRED: Sponge API 7.3+; Grief Defender 2+; LuckPerms 5.3.X;** **OPTIONAL: Nucleus 2.3.2+** diff --git a/gradle.properties b/gradle.properties index cda4150..5db83dd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ ## Version major=0 minor=32 -patch=0 +patch=1 api=S7.13 suffix=GRIEF-DEFENDER-2-SNAPSHOT ## Dependencies diff --git a/src/main/java/net/mohron/skyclaims/config/type/WorldConfig.java b/src/main/java/net/mohron/skyclaims/config/type/WorldConfig.java index 1403ba9..4067041 100644 --- a/src/main/java/net/mohron/skyclaims/config/type/WorldConfig.java +++ b/src/main/java/net/mohron/skyclaims/config/type/WorldConfig.java @@ -31,6 +31,7 @@ @ConfigSerializable public class WorldConfig { + private static final UUID NIL_UUID = new UUID(0, 0); @Setting(value = "SkyClaims-World-UUID", comment = "Sponge UUID of the world to manage islands in") @@ -76,10 +77,27 @@ public World getWorld() { } } + public World getSpawnWorld() { + if (!isSeparateSpawn()) { + return getWorld(); + } + final Optional world = Sponge.getServer().getWorld(spawnWorld); + if (world.isPresent()) { + return world.get(); + } else { + SkyClaims.getInstance().getLogger().error("World \"" + spawnWorld + "\" cannot be found."); + return getWorld(); + } + } + public Location getSpawn() { - World world = getWorld(); + World world = getSpawnWorld(); SkyClaims.getInstance().getLogger().debug("Spawn World: {}", world.getName()); - return world.isLoaded() ? world.getSpawnLocation() : getWorld().getSpawnLocation(); + if (!world.isLoaded()) { + SkyClaims.getInstance().getLogger().error("World \"" + spawnWorld + "\" is not loaded."); + return getWorld().getSpawnLocation(); + } + return world.getSpawnLocation(); } public boolean isSeparateSpawn() {