From ea8f76493141717296e1f59fbdab21c39f1937be Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Fri, 13 May 2022 21:17:46 -0400 Subject: refactor and encapsulate classes --- src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java') 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")); } -- cgit v1.2.3-freya