use of de.dytanic.cloudnet.lib.proxylayout.TabList in project CloudNet by Dytanic.
the class ProxiedListener method initTabHeaderFooter.
private void initTabHeaderFooter(ProxiedPlayer proxiedPlayer) {
TabList tabList = CloudProxy.getInstance().getProxyGroup().getProxyConfig().getTabList();
proxiedPlayer.setTabHeader(new TextComponent(ChatColor.translateAlternateColorCodes('&', tabList.getHeader().replace("%proxy%", CloudAPI.getInstance().getServerId()).replace("%server%", (proxiedPlayer.getServer() != null ? proxiedPlayer.getServer().getInfo().getName() : CloudProxy.getInstance().getProxyGroup().getName())).replace("%online_players%", CloudAPI.getInstance().getOnlineCount() + NetworkUtils.EMPTY_STRING).replace("%max_players%", CloudProxy.getInstance().getProxyGroup().getProxyConfig().getMaxPlayers() + NetworkUtils.EMPTY_STRING).replace("%group%", (proxiedPlayer.getServer() != null && CloudProxy.getInstance().getCachedServers().containsKey(proxiedPlayer.getServer().getInfo().getName()) ? CloudProxy.getInstance().getCachedServers().get(proxiedPlayer.getServer().getInfo().getName()).getServiceId().getGroup() : "Hub")).replace("%proxy_group%", CloudProxy.getInstance().getProxyGroup().getName()))), new TextComponent(ChatColor.translateAlternateColorCodes('&', tabList.getFooter().replace("%proxy%", CloudAPI.getInstance().getServerId()).replace("%server%", (proxiedPlayer.getServer() != null ? proxiedPlayer.getServer().getInfo().getName() : CloudProxy.getInstance().getProxyGroup().getName())).replace("%online_players%", CloudAPI.getInstance().getOnlineCount() + NetworkUtils.EMPTY_STRING).replace("%max_players%", CloudProxy.getInstance().getProxyGroup().getProxyConfig().getMaxPlayers() + NetworkUtils.EMPTY_STRING).replace("%group%", (proxiedPlayer.getServer() != null && CloudProxy.getInstance().getCachedServers().containsKey(proxiedPlayer.getServer().getInfo().getName()) ? CloudProxy.getInstance().getCachedServers().get(proxiedPlayer.getServer().getInfo().getName()).getServiceId().getGroup() : "Hub")).replace("%proxy_group%", CloudProxy.getInstance().getProxyGroup().getName()))));
}
Aggregations