SteamWar/BungeeCore
Archiviert
13
2

Revert "Fix NPE"

This reverts commit e1a0c4802f.
Dieser Commit ist enthalten in:
Lixfel 2023-12-19 16:54:41 +01:00
Ursprung 1b3ed278c6
Commit 5162c5b05b

Datei anzeigen

@ -222,15 +222,10 @@ 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";
SteamwarUser steamwarUser = SteamwarUser.get(item.getUuid()); UserPerm.Prefix prefix = SteamwarUser.get(item.getUuid()).prefix();
if (steamwarUser == null) {
color = "§7";
} else {
UserPerm.Prefix prefix = steamwarUser.prefix();
if (prefix != UserPerm.emptyPrefix || !TablistServer.hasTeamColor(viewee, item.getUuid())) { if (prefix != UserPerm.emptyPrefix || !TablistServer.hasTeamColor(viewee, item.getUuid())) {
color = prefix.getChatPrefix(); color = prefix.getChatPrefix();
} }
}
item.setDisplayName(TextComponent.fromLegacy(color + item.getUsername())); item.setDisplayName(TextComponent.fromLegacy(color + item.getUsername()));
} }
item.setPublicKey(null); item.setPublicKey(null);
@ -288,15 +283,10 @@ 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";
SteamwarUser steamwarUser = SteamwarUser.get(item.getUuid()); UserPerm.Prefix prefix = SteamwarUser.get(item.getUuid()).prefix();
if (steamwarUser == null) {
color = "§7";
} else {
UserPerm.Prefix prefix = steamwarUser.prefix();
if (prefix != UserPerm.emptyPrefix || !TablistServer.hasTeamColor(viewee, item.getUuid())) { if (prefix != UserPerm.emptyPrefix || !TablistServer.hasTeamColor(viewee, item.getUuid())) {
color = prefix.getChatPrefix(); color = prefix.getChatPrefix();
} }
}
item.setDisplayName(TextComponent.fromLegacy(color + item.getUsername())); item.setDisplayName(TextComponent.fromLegacy(color + item.getUsername()));
} }
item.setPublicKey(null); item.setPublicKey(null);