diff options
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java')
-rw-r--r-- | src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java index 9c1e3d7..cacf7cd 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java @@ -1,6 +1,6 @@ package net.tylermurphy.hideAndSeek.command; -import static net.tylermurphy.hideAndSeek.Store.*; +import static net.tylermurphy.hideAndSeek.Config.*; import org.bukkit.Bukkit; import org.bukkit.GameMode; @@ -10,20 +10,21 @@ import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import net.tylermurphy.hideAndSeek.util.Functions; -import net.tylermurphy.hideAndSeek.util.ICommand; +import net.tylermurphy.hideAndSeek.Main; +import net.tylermurphy.hideAndSeek.events.Worldborder; import net.tylermurphy.hideAndSeek.util.Packet; +import net.tylermurphy.hideAndSeek.util.Util; public class Stop implements ICommand { public void execute(CommandSender sender, String[] args) { - if(!Functions.setup()) { + if(!Util.isSetup()) { sender.sendMessage(errorPrefix + "Game is not setup. Run /hs setup to see what you needed to do"); return; } - if(status.equals("Starting") || status.equals("Playing")) { + if(Main.plugin.status.equals("Starting") || Main.plugin.status.equals("Playing")) { if(announceMessagesToNonPlayers) Bukkit.broadcastMessage(abortPrefix + "Game has been force stopped."); - else Functions.broadcastMessage(abortPrefix + "Game has been force stopped."); + else Util.broadcastMessage(abortPrefix + "Game has been force stopped."); onStop(); } else { @@ -37,26 +38,25 @@ public class Stop implements ICommand { } public static void onStop() { - if(status.equals("Standby")) return; - status = "Standby"; - gameId++; - Functions.resetWorldborder("hideandseek_"+spawnWorld); - for(Player player : playerList.values()) { + if(Main.plugin.status.equals("Standby")) return; + Main.plugin.status = "Standby"; + Main.plugin.gameId++; + Worldborder.resetWorldborder("hideandseek_"+spawnWorld); + for(Player player : Main.plugin.board.getPlayers()) { player.setGameMode(GameMode.ADVENTURE); player.setLevel(0); - Hider.add(player.getName()); - HiderTeam.addEntry(player.getName()); + Main.plugin.board.addHider(player); player.getInventory().clear(); player.teleport(new Location(Bukkit.getWorld(lobbyWorld), lobbyPosition.getX(),lobbyPosition.getY(),lobbyPosition.getZ())); for(PotionEffect effect : player.getActivePotionEffects()){ player.removePotionEffect(effect.getType()); } player.addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 1, 100)); - for(Player temp : playerList.values()) { + for(Player temp : Main.plugin.board.getPlayers()) { Packet.setGlow(player, temp, false); } } - Functions.unloadMap("hideandseek_"+spawnWorld); + Util.unloadMap("hideandseek_"+spawnWorld); } public String getUsage() { |