From 3307989f5a3f31ac89d7d704e9599d35e9da8b13 Mon Sep 17 00:00:00 2001 From: OllieMartin Date: Mon, 20 Jul 2020 15:19:03 +0100 Subject: [PATCH 1/3] Attempt to add better support for untranslated RGB codes in meta --- .../multichat/local/spigot/LocalSpigotMetaManager.java | 5 +++-- .../multichat/local/sponge/LocalSpongeMetaManager.java | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/multichat/src/main/java/xyz/olivermartin/multichat/local/spigot/LocalSpigotMetaManager.java b/multichat/src/main/java/xyz/olivermartin/multichat/local/spigot/LocalSpigotMetaManager.java index 7e0be27d..2c5a0f01 100644 --- a/multichat/src/main/java/xyz/olivermartin/multichat/local/spigot/LocalSpigotMetaManager.java +++ b/multichat/src/main/java/xyz/olivermartin/multichat/local/spigot/LocalSpigotMetaManager.java @@ -28,7 +28,7 @@ public String getPrefix(UUID uuid) { return MultiChatUtil.approximateHexCodes(vaultChat.getPlayerPrefix(Bukkit.getServer().getPlayer(uuid))); } - return vaultChat.getPlayerPrefix(Bukkit.getServer().getPlayer(uuid)); + return MultiChatUtil.reformatRGB(vaultChat.getPlayerPrefix(Bukkit.getServer().getPlayer(uuid))); } @@ -50,7 +50,7 @@ public String getSuffix(UUID uuid) { return MultiChatUtil.approximateHexCodes(vaultChat.getPlayerSuffix(Bukkit.getServer().getPlayer(uuid))); } - return vaultChat.getPlayerSuffix(Bukkit.getServer().getPlayer(uuid)); + return MultiChatUtil.reformatRGB(vaultChat.getPlayerSuffix(Bukkit.getServer().getPlayer(uuid))); } @@ -86,6 +86,7 @@ public String getDisplayName(UUID uuid) { displayNameFormat = displayNameFormat.replaceAll("%NAME%", player.getName()); displayNameFormat = displayNameFormat.replaceAll("%PREFIX%", getPrefix(uuid)); displayNameFormat = displayNameFormat.replaceAll("%SUFFIX%", getSuffix(uuid)); + displayNameFormat = MultiChatUtil.reformatRGB(displayNameFormat); displayNameFormat = displayNameFormat.replaceAll("&(?=[a-f,0-9,k-o,r,x])", "§"); // LEGACY HACK diff --git a/multichat/src/main/java/xyz/olivermartin/multichat/local/sponge/LocalSpongeMetaManager.java b/multichat/src/main/java/xyz/olivermartin/multichat/local/sponge/LocalSpongeMetaManager.java index 0a2ce8de..bcb10967 100644 --- a/multichat/src/main/java/xyz/olivermartin/multichat/local/sponge/LocalSpongeMetaManager.java +++ b/multichat/src/main/java/xyz/olivermartin/multichat/local/sponge/LocalSpongeMetaManager.java @@ -24,7 +24,7 @@ public String getPrefix(UUID uuid) { Player player = opPlayer.get(); if (player.getOption("prefix").isPresent()) { - return MultiChatUtil.approximateHexCodes(player.getOption("prefix").get()); + return MultiChatUtil.approximateHexCodes(MultiChatUtil.reformatRGB(player.getOption("prefix").get())); } else { return ""; } @@ -45,7 +45,7 @@ public String getSuffix(UUID uuid) { Player player = opPlayer.get(); if (player.getOption("suffix").isPresent()) { - return MultiChatUtil.approximateHexCodes(player.getOption("suffix").get()); + return MultiChatUtil.approximateHexCodes(MultiChatUtil.reformatRGB(player.getOption("suffix").get())); } else { return ""; } @@ -92,8 +92,9 @@ public String getDisplayName(UUID uuid) { displayNameFormat = displayNameFormat.replaceAll("%NAME%", player.getName()); displayNameFormat = displayNameFormat.replaceAll("%PREFIX%", getPrefix(uuid)); displayNameFormat = displayNameFormat.replaceAll("%SUFFIX%", getSuffix(uuid)); + displayNameFormat = MultiChatUtil.reformatRGB(displayNameFormat); displayNameFormat = displayNameFormat.replaceAll("&(?=[a-f,0-9,k-o,r,x])", "§"); - + displayNameFormat = MultiChatUtil.approximateHexCodes(displayNameFormat); // TODO Sponge doesn't seem to like this... So we tend to work around it by sending back our original string From aaf6bad59ae498254c6bf1bbcc06409803a44514 Mon Sep 17 00:00:00 2001 From: OllieMartin Date: Mon, 20 Jul 2020 15:28:33 +0100 Subject: [PATCH 2/3] Incremented version to 1.9.4 --- multichat/pom.xml | 2 +- .../java/xyz/olivermartin/multichat/bungee/MultiChat.java | 7 ++++--- .../multichat/local/sponge/MultiChatLocalSpongePlugin.java | 2 +- multichat/src/main/resources/bungee.yml | 2 +- multichat/src/main/resources/chatcontrol.yml | 2 +- multichat/src/main/resources/chatcontrol_fr.yml | 2 +- multichat/src/main/resources/config.yml | 2 +- multichat/src/main/resources/config_fr.yml | 2 +- multichat/src/main/resources/joinmessages.yml | 2 +- multichat/src/main/resources/joinmessages_fr.yml | 2 +- multichat/src/main/resources/localconfig.yml | 2 +- multichat/src/main/resources/localconfig_fr.yml | 2 +- multichat/src/main/resources/messages.yml | 2 +- multichat/src/main/resources/messages_fr.yml | 2 +- multichat/src/main/resources/plugin.yml | 2 +- 15 files changed, 18 insertions(+), 17 deletions(-) diff --git a/multichat/pom.xml b/multichat/pom.xml index 8a6b1b4b..6f5bb289 100644 --- a/multichat/pom.xml +++ b/multichat/pom.xml @@ -5,7 +5,7 @@ xyz.olivermartin.multichat multichat - 1.9.3 + 1.9.4 diff --git a/multichat/src/main/java/xyz/olivermartin/multichat/bungee/MultiChat.java b/multichat/src/main/java/xyz/olivermartin/multichat/bungee/MultiChat.java index a01aae8e..ac11f750 100644 --- a/multichat/src/main/java/xyz/olivermartin/multichat/bungee/MultiChat.java +++ b/multichat/src/main/java/xyz/olivermartin/multichat/bungee/MultiChat.java @@ -37,11 +37,12 @@ */ public class MultiChat extends Plugin implements Listener { - public static final String LATEST_VERSION = "1.9.3"; + public static final String LATEST_VERSION = "1.9.4"; public static final String[] ALLOWED_VERSIONS = new String[] { LATEST_VERSION, + "1.9.3", "1.9.2", "1.9.1", "1.9", @@ -98,7 +99,7 @@ public class MultiChat extends Plugin implements Listener { public static boolean hideVanishedStaffInMsg = true; public static boolean hideVanishedStaffInStaffList = true; public static boolean hideVanishedStaffInJoin = true; - + public static List legacyServers = new ArrayList(); public static MultiChat getInstance() { @@ -346,7 +347,7 @@ public void onEnable() { logStaffChat = configYML.getSection("privacy_settings").getBoolean("log_staffchat"); logGroupChat = configYML.getSection("privacy_settings").getBoolean("log_groupchat"); } - + // Legacy servers for RGB approximation if (configYML.contains("legacy_servers")) { legacyServers = configYML.getStringList("legacy_servers"); diff --git a/multichat/src/main/java/xyz/olivermartin/multichat/local/sponge/MultiChatLocalSpongePlugin.java b/multichat/src/main/java/xyz/olivermartin/multichat/local/sponge/MultiChatLocalSpongePlugin.java index 7295c175..bfa54548 100644 --- a/multichat/src/main/java/xyz/olivermartin/multichat/local/sponge/MultiChatLocalSpongePlugin.java +++ b/multichat/src/main/java/xyz/olivermartin/multichat/local/sponge/MultiChatLocalSpongePlugin.java @@ -56,7 +56,7 @@ import xyz.olivermartin.multichat.local.sponge.listeners.communication.LocalSpongePlayerChannelListener; import xyz.olivermartin.multichat.local.sponge.listeners.communication.LocalSpongePlayerMetaListener; -@Plugin(id = "multichat", name = "MultiChat", version = "1.9.3", dependencies = { @Dependency(id = "placeholderapi", optional = true) }) +@Plugin(id = "multichat", name = "MultiChat", version = "1.9.4", dependencies = { @Dependency(id = "placeholderapi", optional = true) }) public class MultiChatLocalSpongePlugin { @Inject diff --git a/multichat/src/main/resources/bungee.yml b/multichat/src/main/resources/bungee.yml index 8b8e363e..b49b4bca 100644 --- a/multichat/src/main/resources/bungee.yml +++ b/multichat/src/main/resources/bungee.yml @@ -1,6 +1,6 @@ name: MultiChat main: xyz.olivermartin.multichat.bungee.MultiChat -version: 1.9.3 +version: 1.9.4 author: Revilo410 api-version: 1.16 softdepends: [PremiumVanish] diff --git a/multichat/src/main/resources/chatcontrol.yml b/multichat/src/main/resources/chatcontrol.yml index 534f1d17..7acfe321 100644 --- a/multichat/src/main/resources/chatcontrol.yml +++ b/multichat/src/main/resources/chatcontrol.yml @@ -8,7 +8,7 @@ ################## # DON'T EDIT # -version: "1.9.3" # +version: "1.9.4" # ################## # 1. Chat Control Rules diff --git a/multichat/src/main/resources/chatcontrol_fr.yml b/multichat/src/main/resources/chatcontrol_fr.yml index 1033664d..e5fb66aa 100644 --- a/multichat/src/main/resources/chatcontrol_fr.yml +++ b/multichat/src/main/resources/chatcontrol_fr.yml @@ -8,7 +8,7 @@ ################## # NE PAS EDITER # -version: "1.9.3" # +version: "1.9.4" # ################## # French Translation by Nogapra - Thank you ! diff --git a/multichat/src/main/resources/config.yml b/multichat/src/main/resources/config.yml index 8dd017b6..5cd6da71 100644 --- a/multichat/src/main/resources/config.yml +++ b/multichat/src/main/resources/config.yml @@ -8,7 +8,7 @@ ################## # DON'T EDIT # -version: "1.9.3" # +version: "1.9.4" # ################## # 1. General diff --git a/multichat/src/main/resources/config_fr.yml b/multichat/src/main/resources/config_fr.yml index f2bc874a..ff3ce430 100644 --- a/multichat/src/main/resources/config_fr.yml +++ b/multichat/src/main/resources/config_fr.yml @@ -8,7 +8,7 @@ ################## # NE PAS EDITER # -version: "1.9.3" # +version: "1.9.4" # ################## # French Translation by Nogapra - Thank you ! diff --git a/multichat/src/main/resources/joinmessages.yml b/multichat/src/main/resources/joinmessages.yml index 88e554b9..f065f639 100644 --- a/multichat/src/main/resources/joinmessages.yml +++ b/multichat/src/main/resources/joinmessages.yml @@ -8,7 +8,7 @@ ################## # DON'T EDIT # -version: "1.9.3" # +version: "1.9.4" # ################## ############################################################ diff --git a/multichat/src/main/resources/joinmessages_fr.yml b/multichat/src/main/resources/joinmessages_fr.yml index b15f95bc..9aa83b7e 100644 --- a/multichat/src/main/resources/joinmessages_fr.yml +++ b/multichat/src/main/resources/joinmessages_fr.yml @@ -8,7 +8,7 @@ ################## # Ne pas éditer # -version: "1.9.3" # +version: "1.9.4" # ################## # French Translation by Nogapra - Thank you! diff --git a/multichat/src/main/resources/localconfig.yml b/multichat/src/main/resources/localconfig.yml index 9974ffec..1be496f1 100644 --- a/multichat/src/main/resources/localconfig.yml +++ b/multichat/src/main/resources/localconfig.yml @@ -8,7 +8,7 @@ ################## # DON'T EDIT # -version: "1.9.3" # +version: "1.9.4" # ################## # 1. Global Chat Settings diff --git a/multichat/src/main/resources/localconfig_fr.yml b/multichat/src/main/resources/localconfig_fr.yml index c9aefb1e..4ec92b2c 100644 --- a/multichat/src/main/resources/localconfig_fr.yml +++ b/multichat/src/main/resources/localconfig_fr.yml @@ -8,7 +8,7 @@ ################## # NE PAS EDITER # -version: "1.9.3" # +version: "1.9.4" # ################## # French Translation by Nogapra - Thank you ! diff --git a/multichat/src/main/resources/messages.yml b/multichat/src/main/resources/messages.yml index ced63ba0..93359037 100644 --- a/multichat/src/main/resources/messages.yml +++ b/multichat/src/main/resources/messages.yml @@ -8,7 +8,7 @@ ################## # DON'T EDIT # -version: "1.9.3" # +version: "1.9.4" # ################## ############################################################ diff --git a/multichat/src/main/resources/messages_fr.yml b/multichat/src/main/resources/messages_fr.yml index 3889b6b4..b46c1c6f 100644 --- a/multichat/src/main/resources/messages_fr.yml +++ b/multichat/src/main/resources/messages_fr.yml @@ -8,7 +8,7 @@ ################## # DON'T EDIT # -version: "1.9.3" # +version: "1.9.4" # ################## # French Translation by Nogapra - Thank you! diff --git a/multichat/src/main/resources/plugin.yml b/multichat/src/main/resources/plugin.yml index 8dd7f454..752c719f 100644 --- a/multichat/src/main/resources/plugin.yml +++ b/multichat/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: MultiChat -version: 1.9.3 +version: 1.9.4 author: Revilo410 main: xyz.olivermartin.multichat.local.spigot.MultiChatLocalSpigotPlugin softdepend: [Vault,PlaceholderAPI] From 4f3a28685a36320d753983794f3076c4ba637ebe Mon Sep 17 00:00:00 2001 From: OllieMartin Date: Mon, 20 Jul 2020 15:36:33 +0100 Subject: [PATCH 3/3] Updated to v1.9.4 --- multichat/dependency-reduced-pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multichat/dependency-reduced-pom.xml b/multichat/dependency-reduced-pom.xml index 717be448..0d59965e 100644 --- a/multichat/dependency-reduced-pom.xml +++ b/multichat/dependency-reduced-pom.xml @@ -3,7 +3,7 @@ 4.0.0 xyz.olivermartin.multichat multichat - 1.9.3 + 1.9.4