diff --git a/src/main/java/net/tylermurphy/hideAndSeek/Store.java b/src/main/java/net/tylermurphy/hideAndSeek/Store.java index 470deaa..090bd2c 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/Store.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/Store.java @@ -26,7 +26,7 @@ public class Store { public static int worldborderSize,worldborderDelay,currentWorldborderSize; public static boolean worldborderEnabled = false, decreaseBorder = false; public static String tauntPlayer = ""; - public static HashMap> playerData = new HashMap>(); + public static HashMap playerData = new HashMap(); public static int startTaskId; public static int gameId = 0; @@ -39,29 +39,15 @@ public class Store { } public static int getPlayerData(String playerName, String key) { - HashMap data = playerData.get(playerName); - if(data == null) { - return 0; - } - if(data.get(key) == null) { - return 0; - } - return data.get(key); + return playerData.get(playerName + " " + key) == null ? 0 : playerData.get(playerName + "" + key); } public static void setPlayerData(String playerName, String key, int value) { - HashMap data = playerData.get(playerName); - if(data == null) { - data = new HashMap(); - } - data.put(key, value); - playerData.put(playerName, data); + playerData.put(playerName + " " + key, value); } public static void resetPlayerData(String playerName, boolean giveItems) { - HashMap data = new HashMap(); - data.put("Death", 0); - data.put("GiveStatus", (giveItems) ? 1 : 0); - playerData.put(playerName, data); + playerData.put(playerName+" Death", 0); + playerData.put(playerName+" GiveStatus", (giveItems) ? 1 : 0); } } diff --git a/src/main/java/net/tylermurphy/hideAndSeek/commands/Start.java b/src/main/java/net/tylermurphy/hideAndSeek/commands/Start.java index 6d8d7dd..baf1e46 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/commands/Start.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/commands/Start.java @@ -41,7 +41,7 @@ public class Start implements ICommand { Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "gamerule doImmediateRespawn true"); Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "gamerule logAdminCommands false"); Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "gamerule naturalRegeneration false"); - playerData = new HashMap>(); + playerData = new HashMap(); for(Player player : playerList.values()) { resetPlayerData(player.getName(),true); player.getInventory().clear();