diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2022-06-01 20:03:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-01 20:03:01 -0400 |
commit | c506030cbabe938f0afccbf3489ab72e7463e1e7 (patch) | |
tree | 0cafe99d4b314c761d2621457c4a4a824e53350e /src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java | |
parent | move code of conduct and contributing guidelines (diff) | |
parent | Update CONTRIBUTING.md (diff) | |
download | kenshinshideandseek-c506030cbabe938f0afccbf3489ab72e7463e1e7.tar.gz kenshinshideandseek-c506030cbabe938f0afccbf3489ab72e7463e1e7.tar.bz2 kenshinshideandseek-c506030cbabe938f0afccbf3489ab72e7463e1e7.zip |
Merge pull request #68 from tylermurphy534/1.5.0
1.5.0
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java')
-rw-r--r-- | src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java index 74c29bf..7b29f79 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java @@ -19,44 +19,45 @@ package net.tylermurphy.hideAndSeek.command; -import org.bukkit.command.CommandSender; - import net.tylermurphy.hideAndSeek.Main; - -import static net.tylermurphy.hideAndSeek.configuration.Config.*; +import org.bukkit.entity.Player; import java.io.File; -import static net.tylermurphy.hideAndSeek.configuration.Localization.*; + +import static net.tylermurphy.hideAndSeek.configuration.Config.*; +import static net.tylermurphy.hideAndSeek.configuration.Localization.message; public class Setup implements ICommand { - public void execute(CommandSender sender, String[] args) { + public void execute(Player sender, String[] args) { String msg = message("SETUP").toString(); int count = 0; - if(spawnPosition.getBlockX() == 0 && spawnPosition.getBlockY() == 0 && spawnPosition.getBlockZ() == 0) { + if (spawnPosition.getBlockX() == 0 && spawnPosition.getBlockY() == 0 && spawnPosition.getBlockZ() == 0) { msg = msg + "\n" + message("SETUP_GAME"); count++; } - if(lobbyPosition.getBlockX() == 0 && lobbyPosition.getBlockY() == 0 && lobbyPosition.getBlockZ() == 0) { + if (lobbyPosition.getBlockX() == 0 && lobbyPosition.getBlockY() == 0 && lobbyPosition.getBlockZ() == 0) { msg = msg + "\n" + message("SETUP_LOBBY"); count++; } - if(exitPosition.getBlockX() == 0 && exitPosition.getBlockY() == 0 && exitPosition.getBlockZ() == 0) { + if (exitPosition.getBlockX() == 0 && exitPosition.getBlockY() == 0 && exitPosition.getBlockZ() == 0) { msg = msg + "\n" + message("SETUP_EXIT"); count++; } - if(saveMinX == 0 || saveMinZ == 0 || saveMaxX == 0 || saveMaxZ == 0) { + if (saveMinX == 0 || saveMinZ == 0 || saveMaxX == 0 || saveMaxZ == 0) { msg = msg + "\n" + message("SETUP_BOUNDS"); count++; } - File destenation = new File(Main.root+File.separator+"hideandseek_"+spawnWorld); - if(!destenation.exists()) { - msg = msg + "\n" + message("SETUP_SAVEMAP"); - count++; + if (mapSaveEnabled) { + File destenation = new File(Main.getInstance().getWorldContainer() + File.separator + Main.getInstance().getGame().getGameWorld()); + if (!destenation.exists()) { + msg = msg + "\n" + message("SETUP_SAVEMAP"); + count++; + } } - if(count < 1) { + if (count < 1) { sender.sendMessage(messagePrefix + message("SETUP_COMPLETE")); } else { sender.sendMessage(msg); |