SteamWar/BungeeCore
Archiviert
13
2

Fix NPE
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-12-17 21:57:41 +01:00
Ursprung 23291a7732
Commit e1a0c4802f

Datei anzeigen

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