Make UI elements consistant

This commit is contained in:
ME1312 2018-08-06 22:39:29 -04:00
parent e74178e21c
commit ed1b45fccb
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
8 changed files with 40 additions and 29 deletions

View File

@ -272,11 +272,13 @@ public final class SubPlugin extends BungeeCord implements Listener {
} }
int proxies = 1; int proxies = 1;
if (redis) { if (redis) {
System.out.println("SubServers > "+((status)?"Rel":"L")+"oading Proxies...");
try { try {
boolean first = true;
String master = (String) redis("getServerId"); String master = (String) redis("getServerId");
for (String name : (List<String>) redis("getAllServers")) { for (String name : (List<String>) redis("getAllServers")) {
if (!ukeys.contains(name.toLowerCase()) && !master.equals(name)) try { if (!ukeys.contains(name.toLowerCase()) && !master.equals(name)) try {
if (first) System.out.println("SubServers > "+((status)?"Rel":"L")+"oading Proxies...");
first = false;
Proxy proxy = this.proxies.get(name.toLowerCase()); Proxy proxy = this.proxies.get(name.toLowerCase());
if (proxy == null) { if (proxy == null) {
proxy = new Proxy(name); proxy = new Proxy(name);
@ -395,7 +397,7 @@ public final class SubPlugin extends BungeeCord implements Listener {
YAMLSection edits = new YAMLSection(); YAMLSection edits = new YAMLSection();
if (config.get().getSection("Servers").getSection(name).getBoolean("Enabled") != server.isEnabled()) if (config.get().getSection("Servers").getSection(name).getBoolean("Enabled") != server.isEnabled())
edits.set("enabled", config.get().getSection("Servers").getSection(name).getBoolean("Enabled")); edits.set("enabled", config.get().getSection("Servers").getSection(name).getBoolean("Enabled"));
if (config.get().getSection("Servers").getSection(name).getKeys().contains("Display") && ((config.get().getSection("Servers").getSection(name).getString("Display").length() == 0 && !server.getDisplayName().equals(server.getName())) || !config.get().getSection("Servers").getSection(name).getString("Display").equals(server.getDisplayName()))) if (config.get().getSection("Servers").getSection(name).getKeys().contains("Display") && ((config.get().getSection("Servers").getSection(name).getRawString("Display").length() == 0 && !server.getDisplayName().equals(server.getName())) || !config.get().getSection("Servers").getSection(name).getRawString("Display").equals(server.getDisplayName())))
edits.set("display", config.get().getSection("Servers").getSection(name).getRawString("Display")); edits.set("display", config.get().getSection("Servers").getSection(name).getRawString("Display"));
if (!config.get().getSection("Servers").getSection(name).getString("Host").equalsIgnoreCase(server.getHost().getName())) if (!config.get().getSection("Servers").getSection(name).getString("Host").equalsIgnoreCase(server.getHost().getName()))
edits.set("host", config.get().getSection("Servers").getSection(name).getRawString("Host")); edits.set("host", config.get().getSection("Servers").getSection(name).getRawString("Host"));
@ -460,8 +462,8 @@ public final class SubPlugin extends BungeeCord implements Listener {
server.setAutoRestart(config.get().getSection("Servers").getSection(name).getBoolean("Auto-Restart")); server.setAutoRestart(config.get().getSection("Servers").getSection(name).getBoolean("Auto-Restart"));
if (!status && config.get().getSection("Servers").getSection(name).getBoolean("Run-On-Launch")) if (!status && config.get().getSection("Servers").getSection(name).getBoolean("Run-On-Launch"))
autorun.add(name.toLowerCase()); autorun.add(name.toLowerCase());
if (config.get().getSection("Servers").getSection(name).getKeys().contains("Display") && ((config.get().getSection("Servers").getSection(name).getString("Display").length() == 0 && !server.getDisplayName().equals(server.getName())) || !config.get().getSection("Servers").getSection(name).getString("Display").equals(server.getDisplayName()))) if (config.get().getSection("Servers").getSection(name).getKeys().contains("Display") && ((config.get().getSection("Servers").getSection(name).getRawString("Display").length() == 0 && !server.getDisplayName().equals(server.getName())) || !config.get().getSection("Servers").getSection(name).getRawString("Display").equals(server.getDisplayName())))
server.setDisplayName(config.get().getSection("Servers").getSection(name).getString("Display")); server.setDisplayName(config.get().getSection("Servers").getSection(name).getRawString("Display"));
if (config.get().getSection("Servers").getSection(name).getKeys().contains("Group")) { if (config.get().getSection("Servers").getSection(name).getKeys().contains("Group")) {
for (String group : server.getGroups()) server.removeGroup(group); for (String group : server.getGroups()) server.removeGroup(group);
for (String group : config.get().getSection("Servers").getSection(name).getStringList("Group")) server.addGroup(group); for (String group : config.get().getSection("Servers").getSection(name).getStringList("Group")) server.addGroup(group);

View File

@ -275,7 +275,7 @@ public class InternalUIHandler implements UIHandler, Listener {
} else if (item.equals(plugin.api.getLang("SubServers", "Interface.Generic.Back"))) { } else if (item.equals(plugin.api.getLang("SubServers", "Interface.Generic.Back"))) {
player.closeInventory(); player.closeInventory();
gui.back(); gui.back();
} else if (!item.equals(ChatColor.RESET.toString()) && !item.equals(plugin.api.getLang("SubServers", "Interface.Server-Menu.No-Servers"))) { } else if (!item.equals(ChatColor.RESET.toString()) && !item.startsWith(ChatColor.WHITE.toString()) && !item.equals(plugin.api.getLang("SubServers", "Interface.Server-Menu.No-Servers"))) {
player.closeInventory(); player.closeInventory();
String obj; String obj;
if (event.getCurrentItem().getItemMeta().getLore() != null && event.getCurrentItem().getItemMeta().getLore().size() > 0 && event.getCurrentItem().getItemMeta().getLore().get(0).startsWith(ChatColor.GRAY.toString())) { if (event.getCurrentItem().getItemMeta().getLore() != null && event.getCurrentItem().getItemMeta().getLore().size() > 0 && event.getCurrentItem().getItemMeta().getLore().get(0).startsWith(ChatColor.GRAY.toString())) {

View File

@ -857,12 +857,12 @@ public class InternalUIRenderer extends UIRenderer {
if (hosts.get(server) == null) { if (hosts.get(server) == null) {
block = createItem("STAINED_GLASS_PANE", external.name(), external.get()); block = createItem("STAINED_GLASS_PANE", external.name(), external.get());
blockMeta = block.getItemMeta(); blockMeta = block.getItemMeta();
blockMeta.setDisplayName(ChatColor.AQUA + json.getSection("servers").getSection(server).getString("display")); blockMeta.setDisplayName(ChatColor.WHITE + json.getSection("servers").getSection(server).getString("display"));
LinkedList<String> lore = new LinkedList<String>(); LinkedList<String> lore = new LinkedList<String>();
if (!server.equals(json.getSection("servers").getSection(server).getString("display"))) if (!server.equals(json.getSection("servers").getSection(server).getString("display")))
lore.add(ChatColor.GRAY + server); lore.add(ChatColor.GRAY + server);
lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(json.getSection("servers").getSection(server).getSection("players").getKeys().size())));
lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-External")); lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-External"));
lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(json.getSection("servers").getSection(server).getSection("players").getKeys().size())));
lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Invalid")); lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Invalid"));
lore.add(ChatColor.WHITE + ((plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false))?json.getSection("servers").getSection(server).getString("address"):json.getSection("servers").getSection(server).getString("address").split(":")[json.getSection("servers").getSection(server).getString("address").split(":").length - 1])); lore.add(ChatColor.WHITE + ((plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false))?json.getSection("servers").getSection(server).getString("address"):json.getSection("servers").getSection(server).getString("address").split(":")[json.getSection("servers").getSection(server).getString("address").split(":").length - 1]));
blockMeta.setLore(lore); blockMeta.setLore(lore);
@ -873,8 +873,8 @@ public class InternalUIRenderer extends UIRenderer {
LinkedList<String> lore = new LinkedList<String>(); LinkedList<String> lore = new LinkedList<String>();
if (!server.equals(json.getSection("hosts").getSection(hosts.get(server)).getSection("servers").getSection(server).getString("display"))) if (!server.equals(json.getSection("hosts").getSection(hosts.get(server)).getSection("servers").getSection(server).getString("display")))
lore.add(ChatColor.GRAY + server); lore.add(ChatColor.GRAY + server);
lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(json.getSection("hosts").getSection(hosts.get(server)).getSection("servers").getSection(server).getSection("players").getKeys().size())));
lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary")); lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary"));
lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(json.getSection("hosts").getSection(hosts.get(server)).getSection("servers").getSection(server).getSection("players").getKeys().size())));
lore.add(ChatColor.WHITE + ((plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false))?json.getSection("hosts").getSection(hosts.get(server)).getSection("servers").getSection(server).getString("address"):json.getSection("hosts").getSection(hosts.get(server)).getSection("servers").getSection(server).getString("address").split(":")[json.getSection("hosts").getSection(hosts.get(server)).getSection("servers").getSection(server).getString("address").split(":").length - 1])); lore.add(ChatColor.WHITE + ((plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false))?json.getSection("hosts").getSection(hosts.get(server)).getSection("servers").getSection(server).getString("address"):json.getSection("hosts").getSection(hosts.get(server)).getSection("servers").getSection(server).getString("address").split(":")[json.getSection("hosts").getSection(hosts.get(server)).getSection("servers").getSection(server).getString("address").split(":").length - 1]));
blockMeta.setLore(lore); blockMeta.setLore(lore);
} else if (json.getSection("hosts").getSection(hosts.get(server)).getSection("servers").getSection(server).getBoolean("running")) { } else if (json.getSection("hosts").getSection(hosts.get(server)).getSection("servers").getSection(server).getBoolean("running")) {
@ -1095,8 +1095,8 @@ public class InternalUIRenderer extends UIRenderer {
LinkedList<String> lore = new LinkedList<String>(); LinkedList<String> lore = new LinkedList<String>();
if (!subserver.equals(json.getSection("server").getString("display"))) if (!subserver.equals(json.getSection("server").getString("display")))
lore.add(ChatColor.GRAY + subserver); lore.add(ChatColor.GRAY + subserver);
lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(json.getSection("server").getSection("players").getKeys().size())));
lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary")); lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary"));
lore.add(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(json.getSection("server").getSection("players").getKeys().size())));
lore.add(ChatColor.WHITE + ((plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false))?json.getSection("server").getString("address"):json.getSection("server").getString("address").split(":")[json.getSection("server").getString("address").split(":").length - 1])); lore.add(ChatColor.WHITE + ((plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false))?json.getSection("server").getString("address"):json.getSection("server").getString("address").split(":")[json.getSection("server").getString("address").split(":").length - 1]));
blockMeta.setLore(lore); blockMeta.setLore(lore);
} else if (json.getSection("server").getBoolean("running")) { } else if (json.getSection("server").getBoolean("running")) {

View File

@ -48,7 +48,7 @@ public class BungeeChat {
hoverm = new LinkedList<TextComponent>(); hoverm = new LinkedList<TextComponent>();
message = new TextComponent(data.getSection("groups").getSection(group).getSection(server).getString("display")); message = new TextComponent(data.getSection("groups").getSection(group).getSection(server).getString("display"));
hover = new TextComponent(data.getSection("groups").getSection(group).getSection(server).getString("display") + '\n'); hover = new TextComponent(data.getSection("groups").getSection(group).getSection(server).getString("display") + '\n');
if (data.getSection("groups").getSection(group).getSection(server).getKeys().contains("enabled")) { if (data.getSection("groups").getSection(group).getSection(server).getKeys().contains("host")) {
message.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, label + " open SubServer/ " + server)); message.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, label + " open SubServer/ " + server));
if (data.getSection("groups").getSection(group).getSection(server).getBoolean("temp")) { if (data.getSection("groups").getSection(group).getSection(server).getBoolean("temp")) {
message.setColor(ChatColor.AQUA); message.setColor(ChatColor.AQUA);
@ -59,9 +59,9 @@ public class BungeeChat {
hover.setColor(ChatColor.GRAY); hover.setColor(ChatColor.GRAY);
hoverm.add(hover); hoverm.add(hover);
} }
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(data.getSection("groups").getSection(group).getSection(server).getSection("players").getKeys().size())) + '\n'); hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary") + '\n');
hoverm.add(hover); hoverm.add(hover);
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary")); hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(data.getSection("groups").getSection(group).getSection(server).getSection("players").getKeys().size())));
} else if (data.getSection("groups").getSection(group).getSection(server).getBoolean("running")) { } else if (data.getSection("groups").getSection(group).getSection(server).getBoolean("running")) {
message.setColor(ChatColor.GREEN); message.setColor(ChatColor.GREEN);
hover.setColor(ChatColor.GREEN); hover.setColor(ChatColor.GREEN);
@ -119,10 +119,12 @@ public class BungeeChat {
hoverm.add(hover); hoverm.add(hover);
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-External")); hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-External"));
hoverm.add(hover); hoverm.add(hover);
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(data.getSection("groups").getSection(group).getSection(server).getSection("players").getKeys().size())) + '\n');
hoverm.add(hover);
if (plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false)) { if (plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false)) {
hover = new TextComponent('\n' + data.getSection("servers").getSection(server).getString("address")); hover = new TextComponent('\n' + data.getSection("groups").getSection(group).getSection(server).getString("address"));
} else { } else {
hover = new TextComponent('\n' + data.getSection("servers").getSection(server).getString("address").split(":")[data.getSection("servers").getSection(server).getString("address").split(":").length - 1]); hover = new TextComponent('\n' + data.getSection("groups").getSection(group).getSection(server).getString("address").split(":")[data.getSection("groups").getSection(group).getSection(server).getString("address").split(":").length - 1]);
} }
hover.setColor(ChatColor.WHITE); hover.setColor(ChatColor.WHITE);
hoverm.add(hover); hoverm.add(hover);
@ -192,9 +194,9 @@ public class BungeeChat {
hover.setColor(ChatColor.GRAY); hover.setColor(ChatColor.GRAY);
hoverm.add(hover); hoverm.add(hover);
} }
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(data.getSection("hosts").getSection(host).getSection("servers").getSection(subserver).getSection("players").getKeys().size())) + '\n'); hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary") + '\n');
hoverm.add(hover); hoverm.add(hover);
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary")); hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(data.getSection("hosts").getSection(host).getSection("servers").getSection(subserver).getSection("players").getKeys().size())));
} else if (data.getSection("hosts").getSection(host).getSection("servers").getSection(subserver).getBoolean("running")) { } else if (data.getSection("hosts").getSection(host).getSection("servers").getSection(subserver).getBoolean("running")) {
message.setColor(ChatColor.GREEN); message.setColor(ChatColor.GREEN);
hover.setColor(ChatColor.GREEN); hover.setColor(ChatColor.GREEN);
@ -271,7 +273,9 @@ public class BungeeChat {
hover.setColor(ChatColor.GRAY); hover.setColor(ChatColor.GRAY);
hoverm.add(hover); hoverm.add(hover);
} }
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-External")); hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-External") + '\n');
hoverm.add(hover);
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(data.getSection("servers").getSection(server).getSection("players").getKeys().size())));
hoverm.add(hover); hoverm.add(hover);
if (plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false)) { if (plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false)) {
hover = new TextComponent('\n' + data.getSection("servers").getSection(server).getString("address")); hover = new TextComponent('\n' + data.getSection("servers").getSection(server).getString("address"));

View File

@ -87,7 +87,7 @@ public final class SubCommand implements CommandExecutor {
message += ChatColor.GOLD + group + plugin.api.getLang("SubServers", "Command.List.Header"); message += ChatColor.GOLD + group + plugin.api.getLang("SubServers", "Command.List.Header");
for (String server : data.getSection("groups").getSection(group).getKeys()) { for (String server : data.getSection("groups").getSection(group).getKeys()) {
if (i != 0) message += div; if (i != 0) message += div;
if (!data.getSection("groups").getSection(group).getSection(server).getKeys().contains("enabled")) { if (!data.getSection("groups").getSection(group).getSection(server).getKeys().contains("host")) {
message += ChatColor.WHITE; message += ChatColor.WHITE;
} else if (data.getSection("groups").getSection(group).getSection(server).getBoolean("temp")) { } else if (data.getSection("groups").getSection(group).getSection(server).getBoolean("temp")) {
message += ChatColor.AQUA; message += ChatColor.AQUA;

View File

@ -207,7 +207,7 @@ public final class SubCommand implements CommandExecutor {
for (String server : data.getSection("groups").getSection(group).getKeys()) { for (String server : data.getSection("groups").getSection(group).getKeys()) {
Text.Builder message = Text.builder(data.getSection("groups").getSection(group).getSection(server).getString("display")); Text.Builder message = Text.builder(data.getSection("groups").getSection(group).getSection(server).getString("display"));
Text.Builder hover = Text.builder(data.getSection("groups").getSection(group).getSection(server).getString("display") + '\n'); Text.Builder hover = Text.builder(data.getSection("groups").getSection(group).getSection(server).getString("display") + '\n');
if (data.getSection("groups").getSection(group).getSection(server).getKeys().contains("enabled")) { if (data.getSection("groups").getSection(group).getSection(server).getKeys().contains("host")) {
message.onClick(TextActions.runCommand("/subservers open SubServer/ " + server)); message.onClick(TextActions.runCommand("/subservers open SubServer/ " + server));
if (data.getSection("groups").getSection(group).getSection(server).getBoolean("temp")) { if (data.getSection("groups").getSection(group).getSection(server).getBoolean("temp")) {
message.color(TextColors.AQUA); message.color(TextColors.AQUA);
@ -216,8 +216,8 @@ public final class SubCommand implements CommandExecutor {
hover.append(Text.builder(server + '\n').color(TextColors.GRAY).build()); hover.append(Text.builder(server + '\n').color(TextColors.GRAY).build());
} }
hover.append( hover.append(
Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(data.getSection("groups").getSection(group).getSection(server).getSection("players").getKeys().size())) + '\n'), Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary") + '\n'),
Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary")) Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(data.getSection("groups").getSection(group).getSection(server).getSection("players").getKeys().size())))
); );
} else if (data.getSection("groups").getSection(group).getSection(server).getBoolean("running")) { } else if (data.getSection("groups").getSection(group).getSection(server).getBoolean("running")) {
message.color(TextColors.GREEN); message.color(TextColors.GREEN);
@ -264,11 +264,14 @@ public final class SubCommand implements CommandExecutor {
} else { } else {
message.color(TextColors.WHITE); message.color(TextColors.WHITE);
hover.color(TextColors.WHITE); hover.color(TextColors.WHITE);
hover.append(Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-External"))); hover.append(
Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-External") + '\n'),
Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(data.getSection("groups").getSection(group).getSection(server).getSection("players").getKeys().size())))
);
if (plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false)) { if (plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false)) {
hover.append(Text.builder('\n' + data.getSection("servers").getSection(server).getString("address")).color(TextColors.WHITE).build()); hover.append(Text.builder('\n' + data.getSection("groups").getSection(group).getSection(server).getString("address")).color(TextColors.WHITE).build());
} else { } else {
hover.append(Text.builder('\n' + data.getSection("servers").getSection(server).getString("address").split(":")[data.getSection("servers").getSection(server).getString("address").split(":").length - 1]).color(TextColors.WHITE).build()); hover.append(Text.builder('\n' + data.getSection("groups").getSection(group).getSection(server).getString("address").split(":")[data.getSection("groups").getSection(group).getSection(server).getString("address").split(":").length - 1]).color(TextColors.WHITE).build());
} }
} }
message.onHover(TextActions.showText(hover.build())); message.onHover(TextActions.showText(hover.build()));
@ -321,8 +324,8 @@ public final class SubCommand implements CommandExecutor {
hover.append(Text.builder(subserver + '\n').color(TextColors.GRAY).build()); hover.append(Text.builder(subserver + '\n').color(TextColors.GRAY).build());
} }
hover.append( hover.append(
Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(data.getSection("hosts").getSection(host).getSection("servers").getSection(subserver).getSection("players").getKeys().size())) + '\n'), Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary") + '\n'),
Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary")) Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(data.getSection("hosts").getSection(host).getSection("servers").getSection(subserver).getSection("players").getKeys().size())))
); );
} else if (data.getSection("hosts").getSection(host).getSection("servers").getSection(subserver).getBoolean("running")) { } else if (data.getSection("hosts").getSection(host).getSection("servers").getSection(subserver).getBoolean("running")) {
message.color(TextColors.GREEN); message.color(TextColors.GREEN);
@ -383,7 +386,9 @@ public final class SubCommand implements CommandExecutor {
if (!server.equals(data.getSection("servers").getSection(server).getString("display"))) { if (!server.equals(data.getSection("servers").getSection(server).getString("display"))) {
hover.append(Text.builder(server + '\n').color(TextColors.GRAY).build()); hover.append(Text.builder(server + '\n').color(TextColors.GRAY).build());
} }
hover.append(Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-External"))); hover.append(
Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-External") + '\n'),
Text.of(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(data.getSection("servers").getSection(server).getSection("players").getKeys().size()))));
if (plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false)) { if (plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false)) {
hover.append(Text.builder('\n' + data.getSection("servers").getSection(server).getString("address")).color(TextColors.WHITE).build()); hover.append(Text.builder('\n' + data.getSection("servers").getSection(server).getString("address")).color(TextColors.WHITE).build());
} else { } else {

View File

@ -112,7 +112,7 @@ public class SubCommand {
message += TextColor.GOLD + group + TextColor.RESET + ": "; message += TextColor.GOLD + group + TextColor.RESET + ": ";
for (String server : data.getSection("groups").getSection(group).getKeys()) { for (String server : data.getSection("groups").getSection(group).getKeys()) {
if (i != 0) message += div; if (i != 0) message += div;
if (!data.getSection("groups").getSection(group).getSection(server).contains("enabled")) { if (!data.getSection("groups").getSection(group).getSection(server).contains("host")) {
message += TextColor.WHITE; message += TextColor.WHITE;
} else if (data.getSection("groups").getSection(group).getSection(server).getBoolean("temp")) { } else if (data.getSection("groups").getSection(group).getSection(server).getBoolean("temp")) {
message += TextColor.AQUA; message += TextColor.AQUA;

View File

@ -102,7 +102,7 @@ public final class SubCommand extends CommandX {
message += ChatColor.GOLD + group + ChatColor.RESET + ": "; message += ChatColor.GOLD + group + ChatColor.RESET + ": ";
for (String server : data.getSection("groups").getSection(group).getKeys()) { for (String server : data.getSection("groups").getSection(group).getKeys()) {
if (i != 0) message += div; if (i != 0) message += div;
if (!data.getSection("groups").getSection(group).getSection(server).contains("enabled")) { if (!data.getSection("groups").getSection(group).getSection(server).contains("host")) {
message += ChatColor.WHITE; message += ChatColor.WHITE;
} else if (data.getSection("groups").getSection(group).getSection(server).getBoolean("temp")) { } else if (data.getSection("groups").getSection(group).getSection(server).getBoolean("temp")) {
message += ChatColor.AQUA; message += ChatColor.AQUA;