From 60d2af73610ff93c2186bb5afab16b67af060ea5 Mon Sep 17 00:00:00 2001 From: LlmDl Date: Sat, 20 Aug 2022 18:35:33 -0500 Subject: [PATCH] - Replace % when it is found in the channel formats. - Closes https://github.com/TownyAdvanced/Towny/issues/6125 --- pom.xml | 2 +- resources/changelog.txt | 5 ++++- src/com/palmergames/bukkit/TownyChat/TownyChatFormatter.java | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index b019029..d88f0bc 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.palmergames.bukkit TownyChat jar - 0.96 + 0.97 diff --git a/resources/changelog.txt b/resources/changelog.txt index df6c28b..c8fa623 100644 --- a/resources/changelog.txt +++ b/resources/changelog.txt @@ -405,4 +405,7 @@ v0.96: - Replace the splitter for channels saved in metadata with the , symbol. - Fix the display_channel_join_message_on_joining_the_server option in the config not being used. - Delay the login task by another tick so that the player's locale has been determined on the server. - - Closes https://github.com/TownyAdvanced/Towny/issues/5802 \ No newline at end of file + - Closes https://github.com/TownyAdvanced/Towny/issues/5802 +v0.97: + - Replace % when it is found in the channel formats. + - Closes https://github.com/TownyAdvanced/Towny/issues/6125 \ No newline at end of file diff --git a/src/com/palmergames/bukkit/TownyChat/TownyChatFormatter.java b/src/com/palmergames/bukkit/TownyChat/TownyChatFormatter.java index 07dfdd3..d176f6a 100644 --- a/src/com/palmergames/bukkit/TownyChat/TownyChatFormatter.java +++ b/src/com/palmergames/bukkit/TownyChat/TownyChatFormatter.java @@ -213,7 +213,7 @@ public class TownyChatFormatter { public static String getChatFormat(LocalTownyChatEvent event) { // Replace the {msg} here so it's not regex parsed. - return hexIfCompatible(replacer.replaceAll(event.getFormat(), event).replace("{modplayername}", "%1$s").replace("{msg}", "%2$s")); + return hexIfCompatible(replacer.replaceAll(event.getFormat(), event).replace("%", "").replace("{modplayername}", "%1$s").replace("{msg}", "%2$s")); } /**