summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java
index a8a1887..53ae721 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java
@@ -15,15 +15,19 @@ import static net.tylermurphy.hideAndSeek.configuration.Localization.*;
public class SetLobbyLocation implements ICommand {
public void execute(CommandSender sender, String[] args) {
+ if(!Main.plugin.status.equals("Standby")) {
+ sender.sendMessage(errorPrefix + message("GAME_INPROGRESS"));
+ return;
+ }
Vector newLobbyPosition = 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;
+ }
newLobbyPosition.setX(player.getLocation().getBlockX());
newLobbyPosition.setY(player.getLocation().getBlockY());
newLobbyPosition.setZ(player.getLocation().getBlockZ());
- if(!Main.plugin.status.equals("Standby")) {
- sender.sendMessage(errorPrefix + message("GAME_INPROGRESS"));
- return;
- }
lobbyPosition = newLobbyPosition;
sender.sendMessage(messagePrefix + message("LOBBY_SPAWN"));
addToConfig("spawns.lobby.x", lobbyPosition.getX());