kenshinshideandseek/src/main/java/net/tylermurphy/hideAndSeek/Store.java

58 lines
1.9 KiB
Java
Raw Normal View History

2021-08-13 20:49:36 +00:00
package net.tylermurphy.hideAndSeek;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;
import org.bukkit.util.Vector;
import net.md_5.bungee.api.ChatColor;
public class Store {
public static Map<String,Player> playerList = new HashMap<String,Player>();
public static List<String> loadedPlayers = new ArrayList<String>();
public static Scoreboard board;
public static Team Hider,Seeker,Spectator;
public static String status = "Setup";
public static String messagePrefix = String.format("%sHide and Seek > %s", ChatColor.BLUE, ChatColor.WHITE);
public static String errorPrefix = String.format("%sError > %s", ChatColor.RED, ChatColor.WHITE);
public static Vector spawnPosition,worldborderPosition;
public static int worldborderSize,worldborderDelay,currentWorldborderSize;
public static boolean worldborderEnabled = false, decreaseBorder = false;
public static String tauntPlayer = "";
2021-08-14 02:44:00 +00:00
public static HashMap<String,Integer> playerData = new HashMap<String,Integer>();
2021-08-13 20:49:36 +00:00
public static int startTaskId;
public static int gameId = 0;
public static FileConfiguration getConfig() {
return Main.plugin.getConfig();
}
public static void saveConfig() {
Main.plugin.saveConfig();
}
public static int getPlayerData(String playerName, String key) {
2021-08-14 02:48:21 +00:00
if(playerData.get(playerName + " " + key) == null) {
return 0;
} else {
return playerData.get(playerName + " " + key);
}
2021-08-13 20:49:36 +00:00
}
public static void setPlayerData(String playerName, String key, int value) {
2021-08-14 02:44:00 +00:00
playerData.put(playerName + " " + key, value);
2021-08-13 20:49:36 +00:00
}
public static void resetPlayerData(String playerName, boolean giveItems) {
2021-08-14 02:44:00 +00:00
playerData.put(playerName+" Death", 0);
playerData.put(playerName+" GiveStatus", (giveItems) ? 1 : 0);
2021-08-13 20:49:36 +00:00
}
}