diff --git a/multichat/dependency-reduced-pom.xml b/multichat/dependency-reduced-pom.xml index 0d59965e..b6a4f28d 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.4 + 1.9.5 diff --git a/multichat/pom.xml b/multichat/pom.xml index 6f5bb289..aa6ee45a 100644 --- a/multichat/pom.xml +++ b/multichat/pom.xml @@ -5,7 +5,7 @@ xyz.olivermartin.multichat multichat - 1.9.4 + 1.9.5 diff --git a/multichat/releases/1.9.5/multichat-1.9.5-dev.1.jar b/multichat/releases/1.9.5/multichat-1.9.5-dev.1.jar new file mode 100644 index 00000000..01a62b3c Binary files /dev/null and b/multichat/releases/1.9.5/multichat-1.9.5-dev.1.jar differ 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 ac11f750..b360ca77 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.4"; + public static final String LATEST_VERSION = "1.9.5"; public static final String[] ALLOWED_VERSIONS = new String[] { LATEST_VERSION, + "1.9.4", "1.9.3", "1.9.2", "1.9.1", 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 2c5a0f01..9ceebfdf 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 @@ -8,6 +8,7 @@ import net.milkbowl.vault.chat.Chat; import xyz.olivermartin.multichat.bungee.MultiChatUtil; +import xyz.olivermartin.multichat.local.common.LocalConsoleLogger; import xyz.olivermartin.multichat.local.common.LocalMetaManager; import xyz.olivermartin.multichat.local.common.MultiChatLocal; import xyz.olivermartin.multichat.local.spigot.hooks.LocalSpigotVaultHook; @@ -72,6 +73,8 @@ public String getWorld(UUID uuid) { @Override public String getDisplayName(UUID uuid) { + LocalConsoleLogger logger = MultiChatLocal.getInstance().getConsoleLogger(); + Player player = Bukkit.getPlayer(uuid); if (player == null) return ""; @@ -79,15 +82,31 @@ public String getDisplayName(UUID uuid) { // If MultiChat is setting the display name... if (MultiChatLocal.getInstance().getDataStore().isSetDisplayName()) { + logger.debug("[LocalSpigotMetaManager] We are setting the display name!"); + String displayNameFormat = MultiChatLocal.getInstance().getDataStore().getDisplayNameFormatLastVal(); + logger.debug("[LocalSpigotMetaManager] Format = " + displayNameFormat); + logger.debug("[LocalSpigotMetaManager] Format (using & only) = " + displayNameFormat.replaceAll("(?i)§(?=[a-f,0-9,k-o,r,x])", "&")); + // TODO This stuff could be refactored as it is duplicated between Spigot and Sponge displayNameFormat = displayNameFormat.replaceAll("%NICK%", getNick(uuid)); displayNameFormat = displayNameFormat.replaceAll("%NAME%", player.getName()); displayNameFormat = displayNameFormat.replaceAll("%PREFIX%", getPrefix(uuid)); displayNameFormat = displayNameFormat.replaceAll("%SUFFIX%", getSuffix(uuid)); + + logger.debug("[LocalSpigotMetaManager] Format with placeholders = " + displayNameFormat); + logger.debug("[LocalSpigotMetaManager] Format with placeholders (using & only) = " + displayNameFormat.replaceAll("(?i)§(?=[a-f,0-9,k-o,r,x])", "&")); + displayNameFormat = MultiChatUtil.reformatRGB(displayNameFormat); - displayNameFormat = displayNameFormat.replaceAll("&(?=[a-f,0-9,k-o,r,x])", "§"); + + logger.debug("[LocalSpigotMetaManager] Format after reformatting RGB = " + displayNameFormat); + logger.debug("[LocalSpigotMetaManager] Format after reformatting RGB (using & only) = " + displayNameFormat.replaceAll("(?i)§(?=[a-f,0-9,k-o,r,x])", "&")); + + displayNameFormat = displayNameFormat.replaceAll("(?i)&(?=[a-f,0-9,k-o,r,x])", "§"); + + logger.debug("[LocalSpigotMetaManager] FINAL = " + displayNameFormat); + logger.debug("[LocalSpigotMetaManager] FINAL (using & only) = " + displayNameFormat.replaceAll("(?i)§(?=[a-f,0-9,k-o,r,x])", "&")); // LEGACY HACK if (MultiChatLocal.getInstance().getDataStore().isLegacy()) { diff --git a/multichat/src/main/java/xyz/olivermartin/multichat/local/spigot/LocalSpigotPlaceholderManager.java b/multichat/src/main/java/xyz/olivermartin/multichat/local/spigot/LocalSpigotPlaceholderManager.java index 10a56029..cf9975ae 100644 --- a/multichat/src/main/java/xyz/olivermartin/multichat/local/spigot/LocalSpigotPlaceholderManager.java +++ b/multichat/src/main/java/xyz/olivermartin/multichat/local/spigot/LocalSpigotPlaceholderManager.java @@ -2,6 +2,7 @@ import java.util.UUID; +import xyz.olivermartin.multichat.bungee.MultiChatUtil; import xyz.olivermartin.multichat.local.common.LocalPlaceholderManager; import xyz.olivermartin.multichat.local.common.MultiChatLocalPlatform; @@ -14,6 +15,9 @@ public LocalSpigotPlaceholderManager() { @Override public String buildChatFormat(UUID uuid, String format) { + // Reformat any hex codes in the format + format = MultiChatUtil.reformatRGB(format); + // RESPECT OTHER PLUGIN'S DISPLAY NAMES FIRST! (Allows for factions etc.) format = format.replace("%DISPLAYNAME%", "%1$s"); 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 bcb10967..18acdbcf 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 @@ -93,7 +93,7 @@ public String getDisplayName(UUID uuid) { 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 = displayNameFormat.replaceAll("(?i)&(?=[a-f,0-9,k-o,r,x])", "§"); displayNameFormat = MultiChatUtil.approximateHexCodes(displayNameFormat); diff --git a/multichat/src/main/java/xyz/olivermartin/multichat/local/sponge/LocalSpongePlaceholderManager.java b/multichat/src/main/java/xyz/olivermartin/multichat/local/sponge/LocalSpongePlaceholderManager.java index 2dad6278..ad5963e7 100644 --- a/multichat/src/main/java/xyz/olivermartin/multichat/local/sponge/LocalSpongePlaceholderManager.java +++ b/multichat/src/main/java/xyz/olivermartin/multichat/local/sponge/LocalSpongePlaceholderManager.java @@ -2,6 +2,7 @@ import java.util.UUID; +import xyz.olivermartin.multichat.bungee.MultiChatUtil; import xyz.olivermartin.multichat.local.common.LocalPlaceholderManager; import xyz.olivermartin.multichat.local.common.MultiChatLocalPlatform; @@ -13,7 +14,11 @@ public LocalSpongePlaceholderManager() { @Override public String buildChatFormat(UUID uuid, String format) { - return processMultiChatPlaceholders(uuid, format).replaceAll("&(?=[a-f,0-9,k-o,r])", "§"); + // Reformat any hex codes in the format + format = MultiChatUtil.reformatRGB(format); + format = processMultiChatPlaceholders(uuid, format).replaceAll("(?i)&(?=[a-f,0-9,k-o,r,x])", "§"); + format = MultiChatUtil.approximateHexCodes(format); + return format; } } 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 bfa54548..a0601441 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.4", dependencies = { @Dependency(id = "placeholderapi", optional = true) }) +@Plugin(id = "multichat", name = "MultiChat", version = "1.9.5", 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 b49b4bca..8d77e173 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.4 +version: 1.9.5 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 7acfe321..05d56095 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.4" # +version: "1.9.5" # ################## # 1. Chat Control Rules diff --git a/multichat/src/main/resources/chatcontrol_fr.yml b/multichat/src/main/resources/chatcontrol_fr.yml index e5fb66aa..ea1d8e44 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.4" # +version: "1.9.5" # ################## # French Translation by Nogapra - Thank you ! diff --git a/multichat/src/main/resources/config.yml b/multichat/src/main/resources/config.yml index 5cd6da71..65a6e95f 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.4" # +version: "1.9.5" # ################## # 1. General diff --git a/multichat/src/main/resources/config_fr.yml b/multichat/src/main/resources/config_fr.yml index ff3ce430..c8c67d91 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.4" # +version: "1.9.5" # ################## # French Translation by Nogapra - Thank you ! diff --git a/multichat/src/main/resources/joinmessages.yml b/multichat/src/main/resources/joinmessages.yml index f065f639..b3f5df17 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.4" # +version: "1.9.5" # ################## ############################################################ diff --git a/multichat/src/main/resources/joinmessages_fr.yml b/multichat/src/main/resources/joinmessages_fr.yml index 9aa83b7e..c793379d 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.4" # +version: "1.9.5" # ################## # French Translation by Nogapra - Thank you! diff --git a/multichat/src/main/resources/localconfig.yml b/multichat/src/main/resources/localconfig.yml index 1be496f1..883bfb4f 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.4" # +version: "1.9.5" # ################## # 1. Global Chat Settings diff --git a/multichat/src/main/resources/localconfig_fr.yml b/multichat/src/main/resources/localconfig_fr.yml index 4ec92b2c..a11251ec 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.4" # +version: "1.9.5" # ################## # French Translation by Nogapra - Thank you ! diff --git a/multichat/src/main/resources/messages.yml b/multichat/src/main/resources/messages.yml index 93359037..f85951a1 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.4" # +version: "1.9.5" # ################## ############################################################ diff --git a/multichat/src/main/resources/messages_fr.yml b/multichat/src/main/resources/messages_fr.yml index b46c1c6f..57a737b6 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.4" # +version: "1.9.5" # ################## # French Translation by Nogapra - Thank you! diff --git a/multichat/src/main/resources/plugin.yml b/multichat/src/main/resources/plugin.yml index 752c719f..0dc727d8 100644 --- a/multichat/src/main/resources/plugin.yml +++ b/multichat/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: MultiChat -version: 1.9.4 +version: 1.9.5 author: Revilo410 main: xyz.olivermartin.multichat.local.spigot.MultiChatLocalSpigotPlugin softdepend: [Vault,PlaceholderAPI]