From 5162c5b05b2f8918c3bb84f7ef1d39933b580bdf Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 19 Dec 2023 16:54:41 +0100 Subject: [PATCH] Revert "Fix NPE" This reverts commit e1a0c4802f548a3066fc9a4216ca92e2396f3ec5. --- .../steamwar/bungeecore/tablist/Tablist.java | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/de/steamwar/bungeecore/tablist/Tablist.java b/src/de/steamwar/bungeecore/tablist/Tablist.java index 9559007c..24f2031d 100644 --- a/src/de/steamwar/bungeecore/tablist/Tablist.java +++ b/src/de/steamwar/bungeecore/tablist/Tablist.java @@ -222,14 +222,9 @@ public class Tablist extends MessageToMessageDecoder { item.setListed(false); } else if (item.getDisplayName() == null) { String color = "§f"; - 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(); - } + UserPerm.Prefix prefix = SteamwarUser.get(item.getUuid()).prefix(); + if (prefix != UserPerm.emptyPrefix || !TablistServer.hasTeamColor(viewee, item.getUuid())) { + color = prefix.getChatPrefix(); } item.setDisplayName(TextComponent.fromLegacy(color + item.getUsername())); } @@ -288,14 +283,9 @@ public class Tablist extends MessageToMessageDecoder { item.setListed(false); } else if (item.getDisplayName() == null) { String color = "§f"; - 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(); - } + UserPerm.Prefix prefix = SteamwarUser.get(item.getUuid()).prefix(); + if (prefix != UserPerm.emptyPrefix || !TablistServer.hasTeamColor(viewee, item.getUuid())) { + color = prefix.getChatPrefix(); } item.setDisplayName(TextComponent.fromLegacy(color + item.getUsername())); }