forked from SteamWar/SteamWar
Add RegionConfig
This commit is contained in:
+2
-5
@@ -46,11 +46,8 @@ public class RegionScoreboardElement implements ScoreboardElement {
|
||||
@Override
|
||||
public String get(Region region, Player p) {
|
||||
if (region.getType().isGlobal()) return null;
|
||||
// TODO: Improve this!
|
||||
Optional<File> gameModeConfig = region.getGameModeConfig();
|
||||
if (gameModeConfig.isEmpty()) return null;
|
||||
YamlConfiguration config = YamlConfiguration.loadConfiguration(region.getGameModeConfig().get());
|
||||
List<String> names = config.getStringList("Server.ChatNames");
|
||||
if (!region.getGameModeConfig().isLoaded()) return null;
|
||||
List<String> names = region.getGameModeConfig().getServer().getChatNames();
|
||||
if (names.isEmpty()) return null;
|
||||
return "§e" + BauSystem.MESSAGE.parse("SCOREBOARD_REGION", p) + "§8: §7" + names.get(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user