From d4710f18080ac2fac503f031fbfa2b50b22e8caf Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Wed, 29 Nov 2023 15:32:03 -0600 Subject: [PATCH] Make this more friendly --- .../dev/plex/listener/impl/TabListener.java | 6 +++-- .../main/java/dev/plex/meta/PlayerMeta.java | 8 +++---- server/src/main/resources/config.yml | 24 ++++--------------- 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/server/src/main/java/dev/plex/listener/impl/TabListener.java b/server/src/main/java/dev/plex/listener/impl/TabListener.java index 54a665c..b16ee87 100644 --- a/server/src/main/java/dev/plex/listener/impl/TabListener.java +++ b/server/src/main/java/dev/plex/listener/impl/TabListener.java @@ -1,10 +1,12 @@ package dev.plex.listener.impl; import dev.plex.cache.DataUtils; +import dev.plex.hook.VaultHook; import dev.plex.listener.PlexListener; import dev.plex.meta.PlayerMeta; import dev.plex.player.PlexPlayer; -import net.kyori.adventure.text.Component; +import dev.plex.util.PlexUtils; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -17,6 +19,6 @@ public class TabListener extends PlexListener { Player player = event.getPlayer(); PlexPlayer plexPlayer = DataUtils.getPlayer(player.getUniqueId()); - player.playerListName(Component.text(player.getName()).color(PlayerMeta.getColor(plexPlayer))); + player.playerListName(PlexUtils.mmDeserialize(PlayerMeta.getColor(plexPlayer) + player.getName())); } } diff --git a/server/src/main/java/dev/plex/meta/PlayerMeta.java b/server/src/main/java/dev/plex/meta/PlayerMeta.java index 010c748..74910f4 100644 --- a/server/src/main/java/dev/plex/meta/PlayerMeta.java +++ b/server/src/main/java/dev/plex/meta/PlayerMeta.java @@ -51,17 +51,17 @@ public class PlayerMeta return ""; } - public static TextColor getColor(PlexPlayer plexPlayer) + public static String getColor(PlexPlayer plexPlayer) { if (PlexUtils.DEVELOPERS.contains(plexPlayer.getUuid().toString())) // don't remove or we will front door ur mother { - return NamedTextColor.DARK_PURPLE; + return ""; } String group = VaultHook.getPermission().getPrimaryGroup(null, plexPlayer.getPlayer()); if (Plex.get().getConfig().isSet("colors." + group)) { - return TextColor.color(Plex.get().getConfig().getInt("colors." + group)); + return PlexUtils.mmSerialize(PlexUtils.mmDeserialize(Plex.get().getConfig().getString("colors." + group))); } - return NamedTextColor.WHITE; + return ""; } } diff --git a/server/src/main/resources/config.yml b/server/src/main/resources/config.yml index 5aea641..6de6b0a 100644 --- a/server/src/main/resources/config.yml +++ b/server/src/main/resources/config.yml @@ -25,27 +25,11 @@ chat: name-color: '' # You can define colors for each group which will appear in the tab list -# BLACK = 0x000000 -# DARK_BLUE = 0x0000aa -# DARK_GREEN = 0x00aa00 -# DARK_AQUA = 0x00aaaa -# DARK_RED = 0xaa0000 -# DARK_PURPLE = 0xaa00aa -# GOLD = 0xffaa00 -# GRAY = 0xaaaaaa -# DARK_GRAY = 0x555555 -# BLUE = 0x5555ff -# GREEN = 0x55ff55 -# AQUA = 0x55ffff -# RED = 0xff5555 -# LIGHT_PURPLE = 0xff55ff -# YELLOW = 0xffff55 -# WHITE = 0xffffff colors: - admin: 0x00aa00 - senior: 0xffaa00 - executive: 0x5555ff - masterbuilder: 0x55ffff + admin: '' + senior: '' + executive: '' + masterbuilder: '' # Login Messages loginmessages: