Archiviert
1
0

Change to bigger & better Tablist

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-07-05 13:31:52 +02:00
Ursprung 61c2a7f3a6
Commit 4579551242

Datei anzeigen

@ -74,8 +74,8 @@ public class TablistManager extends BasicListener {
size = (size+19)/20;
if(size > 4)
size = 4;
if(size > 5)
size = 5;
}
private synchronized void updateCustomTablist(){
@ -163,9 +163,9 @@ public class TablistManager extends BasicListener {
i++;
for (ProxiedPlayer p : playerMap.get(server)){
if(currentServer == p.getServer().getInfo())
setSlot(i%20, i/20, BungeeTabListPlusAPI.getIconFromPlayer(p), p.getDisplayName(), 1);
setSlot(i%20, i/20, BungeeTabListPlusAPI.getIconFromPlayer(p), getTablistName(p), 1);
else
setSlot(i%20, i/20, BungeeTabListPlusAPI.getIconFromPlayer(p), "§7" + p.getDisplayName(), 500);
setSlot(i%20, i/20, BungeeTabListPlusAPI.getIconFromPlayer(p), "§7" + getTablistName(p), 500);
i++;
}
}
@ -179,5 +179,22 @@ public class TablistManager extends BasicListener {
//Ignore NPE, happens sometimes (only 1s long) when somebody is joining, server switching or disconnecting
}
}
private String getTablistName(ProxiedPlayer p){
if(p.hasPermission("bungeecore.group.admin"))
return "§4" + p.getName();
else if(p.hasPermission("bungeecore.group.developer"))
return "§3" + p.getName();
else if(p.hasPermission("bungeecore.group.moderator"))
return "§b" + p.getName();
else if(p.hasPermission("bungeecore.group.supporter"))
return "§1" + p.getName();
else if(p.hasPermission("bungeecore.group.builder"))
return "§2" + p.getName();
else if(p.hasPermission("bungeecore.group.youtuber"))
return "§5" + p.getName();
else
return p.getName();
}
}
}