diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2021-10-31 11:25:27 -0400 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2021-10-31 11:25:27 -0400 |
commit | 2a526291526811841d02ff813d9b3a7752570b43 (patch) | |
tree | 5bbac1fc857d4a87446470f1db5356ec89b64536 /src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java | |
parent | 1.3.1 build 3 (diff) | |
download | kenshinshideandseek-2a526291526811841d02ff813d9b3a7752570b43.tar.gz kenshinshideandseek-2a526291526811841d02ff813d9b3a7752570b43.tar.bz2 kenshinshideandseek-2a526291526811841d02ff813d9b3a7752570b43.zip |
1.3.1 build 4
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java')
-rw-r--r-- | src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java index d634968..5324ecf 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java @@ -17,16 +17,20 @@ import static net.tylermurphy.hideAndSeek.configuration.Localization.*; public class SetSpawnLocation implements ICommand { public void execute(CommandSender sender, String[] args) { + if(!Main.plugin.status.equals("Standby")) { + sender.sendMessage(errorPrefix + message("GAME_INPROGRESS")); + return; + } Vector newSpawnPosition = 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; + } newSpawnPosition.setX(player.getLocation().getBlockX()); newSpawnPosition.setY(player.getLocation().getBlockY()); newSpawnPosition.setZ(player.getLocation().getBlockZ()); - if(!Main.plugin.status.equals("Standby")) { - sender.sendMessage(errorPrefix + message("GAME_INPROGRESS")); - return; - } - if(worldborderEnabled && spawnPosition.distance(worldborderPosition) > 100) { + if(worldborderEnabled && newSpawnPosition.distance(worldborderPosition) > 100) { sender.sendMessage(errorPrefix + message("WORLDBORDER_POSITION")); return; } |