summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2021-10-31 11:25:27 -0400
committerTyler Murphy <tylermurphy534@gmail.com>2021-10-31 11:25:27 -0400
commit2a526291526811841d02ff813d9b3a7752570b43 (patch)
tree5bbac1fc857d4a87446470f1db5356ec89b64536 /src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java
parent1.3.1 build 3 (diff)
downloadkenshinshideandseek-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/SetExitLocation.java')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java13
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());