summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/commands/Stop.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/commands/Stop.java')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/commands/Stop.java22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/commands/Stop.java b/src/main/java/net/tylermurphy/hideAndSeek/commands/Stop.java
index b4ccca4..1c31ccd 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/commands/Stop.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/commands/Stop.java
@@ -10,14 +10,15 @@ import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
-import net.tylermurphy.hideAndSeek.ICommand;
-import net.tylermurphy.hideAndSeek.manager.WorldborderManager;
+import net.tylermurphy.hideAndSeek.util.Functions;
+import net.tylermurphy.hideAndSeek.util.ICommand;
public class Stop implements ICommand {
public void execute(CommandSender sender, String[] args) {
if(status.equals("Starting") || status.equals("Playing")) {
- onStop(true);
+ Bukkit.broadcastMessage(messagePrefix + "Game has been force stopped.");
+ onStop();
} else {
sender.sendMessage(errorPrefix + "There is no game in progress");
@@ -29,15 +30,10 @@ public class Stop implements ICommand {
return "stop";
}
- public static void onStop(boolean forced) {
+ public static void onStop() {
if(status.equals("Standby") || status.equals("Setup")) return;
- if(forced) {
- Bukkit.broadcastMessage(messagePrefix + "Game has been force stopped.");
- } else {
- Bukkit.broadcastMessage(messagePrefix + "Game over! All hiders have been found.");
- }
status = "Standby";
- Bukkit.getServer().getScheduler().cancelTask(startTaskId);
+ gameId++;
for(Player player : playerList.values()) {
player.setGameMode(GameMode.ADVENTURE);
Hider.addEntry(player.getName());
@@ -47,9 +43,11 @@ public class Stop implements ICommand {
player.removePotionEffect(effect.getType());
}
player.addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 1, 100));
+ for(Player temp : playerList.values()) {
+ Functions.setGlow(player, temp, false);
+ }
}
- WorldborderManager.reset();
- gameId++;
+ Functions.resetWorldborder();
}
public String getUsage() {