diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java index c9d2fae..e0b8a5d 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java @@ -15,18 +15,21 @@ import static net.tylermurphy.hideAndSeek.configuration.Localization.*; public class SetExitLocation implements ICommand { public void execute(CommandSender sender, String[] args) { + if(!Main.plugin.status.equals("Standby")) { + sender.sendMessage(errorPrefix + message("GAME_INPROGRESS")); + return; + } Vector newExitPosition = new Vector(); Player player = (Player) sender; + if(player.getLocation().getBlockX() == 0 || player.getLocation().getBlockZ() == 0 || player.getLocation().getBlockY() == 0){ + sender.sendMessage(errorPrefix + message("NOT_AT_ZERO")); + return; + } newExitPosition.setX(player.getLocation().getBlockX()); newExitPosition.setY(player.getLocation().getBlockY()); newExitPosition.setZ(player.getLocation().getBlockZ()); - if(!Main.plugin.status.equals("Standby")) { - sender.sendMessage(errorPrefix + message("GAME_INPROGRESS")); - return; - } exitPosition = newExitPosition; sender.sendMessage(messagePrefix + message("EXIT_SPAWN")); - Map<String, Object> temp = new HashMap<String,Object>(); addToConfig("spawns.exit.x", exitPosition.getX()); addToConfig("spawns.exit.y", exitPosition.getY()); addToConfig("spawns.exit.z", exitPosition.getZ()); |