From 5a0cf478782cfcd346a735dfb22681be3faa7a15 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 17 Dec 2023 20:31:53 +0100 Subject: [PATCH] Fix Peer Review issues --- src/de/steamwar/bungeecore/commands/TpCommand.java | 7 ++----- src/de/steamwar/bungeecore/tablist/Tablist.java | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/TpCommand.java b/src/de/steamwar/bungeecore/commands/TpCommand.java index 8dff6f3..b67fe1d 100644 --- a/src/de/steamwar/bungeecore/commands/TpCommand.java +++ b/src/de/steamwar/bungeecore/commands/TpCommand.java @@ -33,10 +33,7 @@ import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.ProxiedPlayer; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; +import java.util.*; public class TpCommand extends SWCommand { @@ -89,7 +86,7 @@ public class TpCommand extends SWCommand { }); } if (Storage.teamServers.containsValue(((ProxiedPlayer) sender).getServer().getInfo())) { - Storage.directTabItems.getOrDefault((ProxiedPlayer) sender, new HashMap<>()).forEach((uuid, item) -> { + Storage.directTabItems.getOrDefault((ProxiedPlayer) sender, Collections.emptyMap()).forEach((uuid, item) -> { list.add(item.getUsername()); }); } diff --git a/src/de/steamwar/bungeecore/tablist/Tablist.java b/src/de/steamwar/bungeecore/tablist/Tablist.java index bfe35b2..4ac0208 100644 --- a/src/de/steamwar/bungeecore/tablist/Tablist.java +++ b/src/de/steamwar/bungeecore/tablist/Tablist.java @@ -218,7 +218,7 @@ public class Tablist extends MessageToMessageDecoder { item.setDisplayName(new TextComponent()); item.setListed(false); } else if (item.getDisplayName() == null) { - item.setDisplayName(new TextComponent("§7" + item.getUsername())); + item.setDisplayName(TextComponent.fromLegacy("§7" + item.getUsername())); } item.setPublicKey(null); if(!player.getUniqueId().equals(item.getUuid()) && item.getGamemode() == 3) @@ -273,7 +273,7 @@ public class Tablist extends MessageToMessageDecoder { item.setDisplayName(new TextComponent()); item.setListed(false); } else if (item.getDisplayName() == null) { - item.setDisplayName(new TextComponent("§7" + item.getUsername())); + item.setDisplayName(TextComponent.fromLegacy("§7" + item.getUsername())); } item.setPublicKey(null); if(!player.getUniqueId().equals(item.getUuid()) && item.getGamemode() == 3)