diff options
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java')
-rw-r--r-- | src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java index f5e63a5..83f2580 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java @@ -19,8 +19,7 @@ package net.tylermurphy.hideAndSeek.command; -import static net.tylermurphy.hideAndSeek.configuration.Config.*; - +import net.tylermurphy.hideAndSeek.Main; import net.tylermurphy.hideAndSeek.game.Game; import net.tylermurphy.hideAndSeek.util.Status; import org.bukkit.Bukkit; @@ -28,30 +27,30 @@ import org.bukkit.World; import org.bukkit.command.CommandSender; import org.bukkit.scheduler.BukkitRunnable; -import net.tylermurphy.hideAndSeek.Main; -import static net.tylermurphy.hideAndSeek.configuration.Localization.*; +import static net.tylermurphy.hideAndSeek.configuration.Config.*; +import static net.tylermurphy.hideAndSeek.configuration.Localization.message; public class SaveMap implements ICommand { public static boolean runningBackup = false; public void execute(CommandSender sender, String[] args) { - if(!mapSaveEnabled){ + if (!mapSaveEnabled) { sender.sendMessage(errorPrefix + message("MAPSAVE_DISABLED")); return; } - if(Game.status != Status.STANDBY) { + if (Game.status != Status.STANDBY) { sender.sendMessage(errorPrefix + message("GAME_INPROGRESS")); return; } - if(spawnPosition.getBlockX() == 0 && spawnPosition.getBlockY() == 0 && spawnPosition.getBlockZ() == 0) { + if (spawnPosition.getBlockX() == 0 && spawnPosition.getBlockY() == 0 && spawnPosition.getBlockZ() == 0) { sender.sendMessage(errorPrefix + message("ERROR_GAME_SPAWN")); return; } sender.sendMessage(messagePrefix + message("MAPSAVE_START")); sender.sendMessage(warningPrefix + message("MAPSAVE_WARNING")); World world = Bukkit.getServer().getWorld(spawnWorld); - if(world == null){ + if (world == null) { throw new RuntimeException("Unable to get world: " + spawnWorld); } world.save(); |