Allow selecting the master proxy in placeholders

This commit is contained in:
ME1312 2020-07-04 23:31:58 -04:00
parent 1564eaaaf9
commit 69fad5221c
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
1 changed files with 4 additions and 3 deletions

View File

@ -137,9 +137,7 @@ public class PlaceholderImpl extends PlaceholderExpansion implements Taskable, C
Server server = (plugin.api.getName() != null)? cache.getServer(plugin.api.getName()) : null;
SubServer subserver = (server instanceof SubServer)? (SubServer) server : null;
Host host = (subserver != null)? cache.getHost(subserver.getHost()) : null;
Proxy proxy = null;
String debug = Arrays.asList(args).toString();
Proxy proxy = cache.getMasterProxy();
method = method.toLowerCase();
if (method.startsWith("proxy.")) {
@ -182,6 +180,9 @@ public class PlaceholderImpl extends PlaceholderExpansion implements Taskable, C
return null;
}
} else switch (method) { // --- Straight up Methods ---
case "example": {
return ChatColor.LIGHT_PURPLE + "Example!";
}
case "proxy":
case "proxies": {
return ChatColor.AQUA + Integer.toString(cache.getProxies().size() + 1);