SteamWar/BungeeCore
Archiviert
13
2

Update Tablist colors #503

Zusammengeführt
Lixfel hat 2 Commits von TpAndTablist nach master 2023-12-19 16:53:10 +01:00 zusammengeführt
Nur Änderungen aus Commit e1a0c4802f werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -222,9 +222,14 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
item.setListed(false);
} else if (item.getDisplayName() == null) {
String color = "§f";
UserPerm.Prefix prefix = SteamwarUser.get(item.getUuid()).prefix();
if (prefix != UserPerm.emptyPrefix || !TablistServer.hasTeamColor(viewee, item.getUuid())) {
color = prefix.getChatPrefix();
SteamwarUser steamwarUser = SteamwarUser.get(item.getUuid());
if (steamwarUser == null) {
color = "§7";
} else {
UserPerm.Prefix prefix = steamwarUser.prefix();
if (prefix != UserPerm.emptyPrefix || !TablistServer.hasTeamColor(viewee, item.getUuid())) {
color = prefix.getChatPrefix();
}
}
item.setDisplayName(TextComponent.fromLegacy(color + item.getUsername()));
}
@ -283,9 +288,14 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
item.setListed(false);
} else if (item.getDisplayName() == null) {
String color = "§f";
UserPerm.Prefix prefix = SteamwarUser.get(item.getUuid()).prefix();
if (prefix != UserPerm.emptyPrefix || !TablistServer.hasTeamColor(viewee, item.getUuid())) {
color = prefix.getChatPrefix();
SteamwarUser steamwarUser = SteamwarUser.get(item.getUuid());
if (steamwarUser == null) {
color = "§7";
} else {
UserPerm.Prefix prefix = steamwarUser.prefix();
if (prefix != UserPerm.emptyPrefix || !TablistServer.hasTeamColor(viewee, item.getUuid())) {
color = prefix.getChatPrefix();
}
}
item.setDisplayName(TextComponent.fromLegacy(color + item.getUsername()));
}