summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java
index 1b1f1d5..9771c2f 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java
@@ -1,6 +1,8 @@
package net.tylermurphy.hideAndSeek.command;
+import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
import net.tylermurphy.hideAndSeek.Store;
import net.tylermurphy.hideAndSeek.util.Functions;
@@ -8,14 +10,25 @@ import net.tylermurphy.hideAndSeek.util.ICommand;
import static net.tylermurphy.hideAndSeek.Store.*;
+import java.util.HashMap;
+
public class Reload implements ICommand {
public void execute(CommandSender sender, String[] args) {
+ if(!status.equals("Standby")) {
+ sender.sendMessage(errorPrefix + "Game is currently in session");
+ return;
+ }
Store.loadConfig();
try {
Functions.loadScoreboard();
} catch(Exception e) {}
sender.sendMessage(messagePrefix + "Reloaded the config");
+ playerList = new HashMap<String,Player>();
+ if(!manualJoin) {
+ for(Player p : Bukkit.getOnlinePlayers())
+ playerList.put(p.getName(), p);
+ }
}
public String getLabel() {