Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Config
- {
- private static Config inst;
- private FileConfiguration cfg;
- private static File mainDir;
- private static File cfgFile;
- public String checkSpawnWorld;
- public int checkSpawnX;
- public int checkSpawnY;
- public int checkSpawnZ;
- public String TeamSpeak;
- static {
- Config.mainDir = Main.getInst().getDataFolder();
- Config.cfgFile = new File(Config.mainDir, "config.yml");
- }
- private Config() {
- this.cfg = Main.getInst().getConfig();
- Config.inst = this;
- }
- public void load() {
- this.checkSpawnWorld = this.cfg.getString("check.World");
- this.checkSpawnX = this.cfg.getInt("check.X");
- this.checkSpawnY = this.cfg.getInt("check.Y");
- this.checkSpawnZ = this.cfg.getInt("check.Z");
- this.TeamSpeak = this.cfg.getString("check.TeamSpeak");
- }
- public static Config getInst() {
- if (Config.inst == null) {
- return new Config();
- }
- return Config.inst;
- }
- public static void check() {
- if (!Config.mainDir.exists()) {
- Config.mainDir.mkdir();
- }
- if (!Config.cfgFile.exists()) {
- Main.getInst().saveDefaultConfig();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement