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/Stop.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 '')
-rw-r--r-- | src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java index b41277b..9280b53 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java @@ -19,27 +19,24 @@ package net.tylermurphy.hideAndSeek.command; -import static net.tylermurphy.hideAndSeek.configuration.Config.*; +import net.tylermurphy.hideAndSeek.Main; +import net.tylermurphy.hideAndSeek.game.util.Status; +import org.bukkit.entity.Player; -import net.tylermurphy.hideAndSeek.game.Game; -import net.tylermurphy.hideAndSeek.util.Status; -import net.tylermurphy.hideAndSeek.util.WinType; -import org.bukkit.Bukkit; -import org.bukkit.command.CommandSender; - -import static net.tylermurphy.hideAndSeek.configuration.Localization.*; +import static net.tylermurphy.hideAndSeek.configuration.Config.abortPrefix; +import static net.tylermurphy.hideAndSeek.configuration.Config.errorPrefix; +import static net.tylermurphy.hideAndSeek.configuration.Localization.message; public class Stop implements ICommand { - public void execute(CommandSender sender, String[] args) { - if(Game.isNotSetup()) { + public void execute(Player sender, String[] args) { + if (Main.getInstance().getGame().isNotSetup()) { sender.sendMessage(errorPrefix + "Game is not setup. Run /hs setup to see what you needed to do"); return; } - if(Game.status == Status.STARTING || Game.status == Status.PLAYING) { - if(announceMessagesToNonPlayers) Bukkit.broadcastMessage(abortPrefix + message("STOP")); - else Game.broadcastMessage(abortPrefix + message("STOP")); - Game.stop(WinType.NONE); + if (Main.getInstance().getGame().getStatus() == Status.STARTING || Main.getInstance().getGame().getStatus() == Status.PLAYING) { + Main.getInstance().getGame().broadcastMessage(abortPrefix + message("STOP")); + Main.getInstance().getGame().end(); } else { sender.sendMessage(errorPrefix + message("GAME_NOT_INPROGRESS")); } |