diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2022-05-13 21:17:46 -0400 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2022-05-13 21:17:46 -0400 |
commit | ea8f76493141717296e1f59fbdab21c39f1937be (patch) | |
tree | 3d6ceeb5baf90f857b88d8a09fc9a07caddf75ce /src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java | |
parent | Merge pull request #53 from bobby29831/1.4.3 (diff) | |
download | kenshinshideandseek-ea8f76493141717296e1f59fbdab21c39f1937be.tar.gz kenshinshideandseek-ea8f76493141717296e1f59fbdab21c39f1937be.tar.bz2 kenshinshideandseek-ea8f76493141717296e1f59fbdab21c39f1937be.zip |
refactor and encapsulate classes
Diffstat (limited to '')
-rw-r--r-- | src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java index 2a310e8..b5f0c17 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java @@ -19,8 +19,8 @@ package net.tylermurphy.hideAndSeek.command; -import net.tylermurphy.hideAndSeek.game.Game; -import net.tylermurphy.hideAndSeek.util.Status; +import net.tylermurphy.hideAndSeek.Main; +import net.tylermurphy.hideAndSeek.game.util.Status; import org.bukkit.command.CommandSender; import static net.tylermurphy.hideAndSeek.configuration.Config.abortPrefix; @@ -30,13 +30,13 @@ import static net.tylermurphy.hideAndSeek.configuration.Localization.message; public class Stop implements ICommand { public void execute(CommandSender sender, String[] args) { - if (Game.isNotSetup()) { + 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) { - Game.broadcastMessage(abortPrefix + message("STOP")); - Game.end(); + 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")); } |