summaryrefslogtreewikicommitdiff
path: root/src/main/java/Store.java
blob: f1aec4d4871271672b90e9ece70efac192823122 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.bukkit.ChatColor;
import org.bukkit.configuration.ConfigurationSection;
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.tylermurphy.hideAndSeek.Main;

public class Store {

	public static Map<String,Player> playerList = new HashMap<String,Player>();
	
	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;
	
	public static Vector worldborderPosition;
	public static int worldborderSize,worldborderDelay,currentWorldborderSize;
	public static boolean worldborderEnabled = false, decreaseBorder = false;
	
	public static List<String> blockedCommands;
	
	public static String tauntPlayer = "";
	
	public static int glowTime = 0;
	
	public static int gameId = 0;
	
	public static FileConfiguration getConfig() {
		return Main.plugin.getConfig();
	}
	
	public static void saveConfig() {
		Main.plugin.saveConfig();
	}
	
	public static void loadConfig() {
		ConfigurationSection spawnConfig = getConfig().getConfigurationSection("spawn");
		if(spawnConfig == null) spawnConfig = getConfig().createSection("spawn");
		spawnPosition = new Vector(spawnConfig.getDouble("x", 0), spawnConfig.getDouble("y", 0), spawnConfig.getDouble("z", 0));
		getConfig().createSection("spawn", spawnConfig.getValues(true));
		ConfigurationSection worldBorderConfig = getConfig().getConfigurationSection("worldBorder");
		if(worldBorderConfig == null) worldBorderConfig = getConfig().createSection("worldBorder");
		worldborderPosition = new Vector(worldBorderConfig.getInt("x", 0), 0, worldBorderConfig.getInt("z", 0));
		worldborderSize = worldBorderConfig.getInt("x", 500);
		worldborderEnabled = worldBorderConfig.getBoolean("enabled", false);
		getConfig().createSection("worldBorder", worldBorderConfig.getValues(true));
		getConfig().addDefault("blockedCommands", new ArrayList<String>());
		blockedCommands = getConfig().getStringList("blockedCommands");
	}
	
}