|
@@ -28,7 +28,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
|
|
|
|
|
import java.io.*;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
-import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
|
|
|
import static org.bukkit.Material.JUKEBOX;
|
|
|
import static org.bukkit.Material.valueOf;
|
|
@@ -128,6 +128,10 @@ public class Config {
|
|
|
cfg.addDefault("mysql.fightmember_table", "mw_fightmember");
|
|
|
|
|
|
cfg.addDefault("sidebar.title", "§eInfo ●§6•");
|
|
|
+ cfg.addDefault("sidebar.member_list_style", "%team_color%%playername%");
|
|
|
+ cfg.addDefault("sidebar.member_list_max", "4");
|
|
|
+
|
|
|
+ //TODO generate list
|
|
|
if (configNew) {
|
|
|
cfg.addDefault("sidebar.entries.6", "§7Time left:");
|
|
|
cfg.addDefault("sidebar.entries.5", "§e» %time%m");
|
|
@@ -149,13 +153,9 @@ public class Config {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static HashMap<String, Integer> getScoreboardEntries() {
|
|
|
- HashMap<String, Integer> ret = new HashMap<>();
|
|
|
- ConfigurationSection section = cfg.getConfigurationSection("sidebar.entries");
|
|
|
- for (String s : section.getKeys(false)) {
|
|
|
- ret.put(section.getString(s), Integer.valueOf(s));
|
|
|
- }
|
|
|
- return ret;
|
|
|
+ public static List<String> getScoreboardEntries() {
|
|
|
+ List<String> scoreboardLines = cfg.getStringList("sidebar.entries");
|
|
|
+ return scoreboardLines;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -195,103 +195,90 @@ public class Config {
|
|
|
return cfg;
|
|
|
}
|
|
|
|
|
|
- public static String motdEnded() {
|
|
|
- return cfg.getString("motd.ended");
|
|
|
+ static boolean debug() {
|
|
|
+ return cfg.getBoolean("debug");
|
|
|
}
|
|
|
|
|
|
- public static String motdGame() {
|
|
|
- return cfg.getString("motd.ingame");
|
|
|
+ public static boolean isSetup() {
|
|
|
+ return cfg.getBoolean("setup_mode");
|
|
|
}
|
|
|
|
|
|
- public static String motdLobby() {
|
|
|
- return cfg.getString("motd.lobby");
|
|
|
+ public static boolean isContactAuth() {
|
|
|
+ return cfg.getBoolean("contact_auth_server");
|
|
|
+ }
|
|
|
+ public static boolean isPrefetchPlayers() {
|
|
|
+ return cfg.getBoolean("prefetch_players");
|
|
|
}
|
|
|
|
|
|
- public static boolean motdEnabled() {
|
|
|
- return cfg.getBoolean("motd.enable");
|
|
|
+ public static int getFightRestart() {
|
|
|
+ return cfg.getInt("restart_after_fights");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static String getArenaFolder() {
|
|
|
+ return cfg.getString("arena_folder") + "/";
|
|
|
+ }
|
|
|
+
|
|
|
+ public static boolean isMultipleLobbies() {
|
|
|
+ return cfg.getBoolean("lobbies.multiple_lobbies");
|
|
|
+ }
|
|
|
+ public static String getLobbiesFolder() {
|
|
|
+ return cfg.getString("lobbies.folder") + "/";
|
|
|
+ }
|
|
|
+ public static String getDefaultLobby() {
|
|
|
+ return cfg.getString("lobbies.default_lobby");
|
|
|
}
|
|
|
|
|
|
public static int getReplaceTicks() {
|
|
|
return cfg.getInt("replace.after_ticks");
|
|
|
}
|
|
|
-
|
|
|
public static int getReplaceRadius() {
|
|
|
return cfg.getInt("replace.radius");
|
|
|
}
|
|
|
|
|
|
- static boolean debug() {
|
|
|
- return cfg.getBoolean("debug");
|
|
|
+ public static String motdEnded() {
|
|
|
+ return cfg.getString("motd.ended");
|
|
|
}
|
|
|
-
|
|
|
- public static boolean isSetup() {
|
|
|
- return cfg.getBoolean("setup_mode");
|
|
|
+ public static String motdGame() {
|
|
|
+ return cfg.getString("motd.ingame");
|
|
|
}
|
|
|
-
|
|
|
- public static int getFightRestart() {
|
|
|
- return cfg.getInt("restart_after_fights");
|
|
|
+ public static String motdLobby() {
|
|
|
+ return cfg.getString("motd.lobby");
|
|
|
+ }
|
|
|
+ public static boolean motdEnabled() {
|
|
|
+ return cfg.getBoolean("motd.enable");
|
|
|
}
|
|
|
|
|
|
- public static String getScoreboardTitle() {
|
|
|
- return cfg.getString("sidebar.title");
|
|
|
+ public static boolean isFightStatsEnabled() {
|
|
|
+ return cfg.getBoolean("fightstats.enable");
|
|
|
+ }
|
|
|
+ public static boolean isShowRealSkins() {
|
|
|
+ return cfg.getBoolean("fightstats.show_real_skins");
|
|
|
}
|
|
|
|
|
|
public static String getHost() {
|
|
|
return cfg.getString("mysql.host");
|
|
|
}
|
|
|
-
|
|
|
public static String getDatabase() {
|
|
|
return cfg.getString("mysql.database");
|
|
|
}
|
|
|
-
|
|
|
public static String getPort() {
|
|
|
return cfg.getString("mysql.port");
|
|
|
}
|
|
|
-
|
|
|
public static String getUser() {
|
|
|
return cfg.getString("mysql.user");
|
|
|
}
|
|
|
-
|
|
|
public static String getPassword() {
|
|
|
return cfg.getString("mysql.password");
|
|
|
}
|
|
|
-
|
|
|
public static String getFightsTable() {
|
|
|
return cfg.getString("mysql.fights_table");
|
|
|
}
|
|
|
-
|
|
|
public static String getFightMembersTable() {
|
|
|
return cfg.getString("mysql.fightmember_table");
|
|
|
}
|
|
|
|
|
|
- public static String getArenaFolder() {
|
|
|
- return cfg.getString("arena_folder") + "/";
|
|
|
- }
|
|
|
-
|
|
|
- public static boolean isContactAuth() {
|
|
|
- return cfg.getBoolean("contact_auth_server");
|
|
|
- }
|
|
|
+ public static String getScoreboardTitle() {return cfg.getString("sidebar.title");}
|
|
|
+ public static String getScoreboardMembersStyle() {return cfg.getString("sidebar.member_list_style");}
|
|
|
+ public static int getScoreboardMembersMax() {return cfg.getInt("sidebar.member_list_max");}
|
|
|
|
|
|
- public static boolean isPrefetchPlayers() {
|
|
|
- return cfg.getBoolean("prefetch_players");
|
|
|
- }
|
|
|
-
|
|
|
- public static boolean isShowRealSkins() {
|
|
|
- return cfg.getBoolean("fightstats.show_real_skins");
|
|
|
- }
|
|
|
-
|
|
|
- public static boolean isMultipleLobbies() {
|
|
|
- return cfg.getBoolean("lobbies.multiple_lobbies");
|
|
|
- }
|
|
|
-
|
|
|
- public static String getLobbiesFolder() {
|
|
|
- return cfg.getString("lobbies.folder") + "/";
|
|
|
- }
|
|
|
-
|
|
|
- public static String getDefaultLobby() {
|
|
|
- return cfg.getString("lobbies.default_lobby");
|
|
|
- }
|
|
|
-
|
|
|
- public static boolean isFightStatsEnabled() {
|
|
|
- return cfg.getBoolean("fightstats.enable");
|
|
|
- }
|
|
|
}
|