diff --git a/src/me/aleksilassila/islands/IslandLayout.java b/src/me/aleksilassila/islands/IslandLayout.java index 5e367d6..a0b76a8 100644 --- a/src/me/aleksilassila/islands/IslandLayout.java +++ b/src/me/aleksilassila/islands/IslandLayout.java @@ -382,6 +382,11 @@ public void deleteIsland(String islandId) { public boolean setSpawnIsland(String islandId) { if (getIslandsConfig().getConfigurationSection(islandId) == null) return false; + if (getIslandsConfig().getBoolean(islandId + ".isSpawn")) { + getIslandsConfig().set(islandId + ".isSpawn", false); + return true; + } + for (String island : getIslandsConfig().getKeys(false)) { if (getIslandsConfig().getBoolean(island + ".isSpawn")) { getIslandsConfig().set(island + ".isSpawn", false); diff --git a/src/me/aleksilassila/islands/commands/subcommands/ClearSubcommand.java b/src/me/aleksilassila/islands/commands/subcommands/ClearSubcommand.java index fb9d208..dac9fac 100644 --- a/src/me/aleksilassila/islands/commands/subcommands/ClearSubcommand.java +++ b/src/me/aleksilassila/islands/commands/subcommands/ClearSubcommand.java @@ -69,7 +69,7 @@ public String help() { @Override public String getPermission() { - return Permissions.command.delete; + return Permissions.command.clear; } @Override diff --git a/src/me/aleksilassila/islands/commands/subcommands/SetSpawnIslandSubcommand.java b/src/me/aleksilassila/islands/commands/subcommands/SetSpawnIslandSubcommand.java index fcc93d9..f4fd091 100644 --- a/src/me/aleksilassila/islands/commands/subcommands/SetSpawnIslandSubcommand.java +++ b/src/me/aleksilassila/islands/commands/subcommands/SetSpawnIslandSubcommand.java @@ -32,10 +32,12 @@ public void onCommand(Player player, String[] args, boolean confirmed) { return; } + boolean removedSpawn = plugin.getIslandsConfig().getBoolean(islandId + ".isSpawn"); + if (!layout.setSpawnIsland(islandId)) player.sendMessage(Messages.get("error.NOT_ON_ISLAND")); else - player.sendMessage(Messages.get("success.SPAWN_ISLAND_CHANGED")); + player.sendMessage(Messages.get(removedSpawn ? "success.SPAWN_ISLAND_REMOVED" : "success.SPAWN_ISLAND_CHANGED")); } @Override diff --git a/src/me/aleksilassila/islands/utils/Permissions.java b/src/me/aleksilassila/islands/utils/Permissions.java index 53b35c8..f6a24e9 100644 --- a/src/me/aleksilassila/islands/utils/Permissions.java +++ b/src/me/aleksilassila/islands/utils/Permissions.java @@ -26,7 +26,7 @@ public static class command { public static final String create = "islands.command.create"; public static final String createCustom = "islands.command.create.custom"; public static final String recreate = "islands.command.recreate"; - public static final String delete = "islands.command.delete"; + public static final String clear = "islands.command.clear"; public static final String give = "islands.command.give"; public static final String name = "islands.command.name"; public static final String unname = "islands.command.unname"; diff --git a/src/messages.properties b/src/messages.properties index 2e47fbc..602addc 100644 --- a/src/messages.properties +++ b/src/messages.properties @@ -32,6 +32,7 @@ success.TRUSTED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aPlayer trusted! success.SPAWN_POINT_CHANGED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aIsland spawn point changed. success.OWNER_REMOVED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aIsland owner removed. success.SPAWN_ISLAND_CHANGED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aGlobal spawn island changed. +success.SPAWN_ISLAND_REMOVED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aGlobal spawn island removed. success.OWNER_CHANGED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aIsland owner switched to {0}. success.NAME_CHANGED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aIsland name changed to {0}. Anyone with your island name can now visit it. success.ISLAND_RECEIVED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aYou are now the owner of {0} island, previously owned by {1}. diff --git a/src/messages_en.properties b/src/messages_en.properties index 2e47fbc..602addc 100644 --- a/src/messages_en.properties +++ b/src/messages_en.properties @@ -32,6 +32,7 @@ success.TRUSTED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aPlayer trusted! success.SPAWN_POINT_CHANGED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aIsland spawn point changed. success.OWNER_REMOVED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aIsland owner removed. success.SPAWN_ISLAND_CHANGED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aGlobal spawn island changed. +success.SPAWN_ISLAND_REMOVED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aGlobal spawn island removed. success.OWNER_CHANGED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aIsland owner switched to {0}. success.NAME_CHANGED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aIsland name changed to {0}. Anyone with your island name can now visit it. success.ISLAND_RECEIVED=\u00a77[\u00a72\u00a7lIslands\u00a77] \u00a7aYou are now the owner of {0} island, previously owned by {1}.