- Fixed: GLOBAL channelTypes (default: general and local channels) are

no longer formatted by TownyChat if modify_chat.enabled is false.
    - DEFAULT, TOWN, NATION & ALLIANCE types are still formatted by
Towny when modify_chat.enable is false.
    - Closes: https://github.com/TownyAdvanced/Towny/issues/3568
This commit is contained in:
Llm Dl committed 2019-12-16 08:40:40 -06:00
1 parent 068b186df0
commit 545ae8b19d
3 files changed
+14 -6

No files matched your search

+3
View File
@@ -288,3 +288,6 @@ v0.65:
or if non was found, the next global channel. or if non was found, the next global channel.
- Ex: While being in townchat you use "/tc" you could find yourself in globalchat. - Ex: While being in townchat you use "/tc" you could find yourself in globalchat.
- Now you will be told you're already in the channel you just used the command to enter into. - Now you will be told you're already in the channel you just used the command to enter into.
- Fixed: GLOBAL channelTypes (default: general and local channels) are no longer formatted by TownyChat if modify_chat.enabled is false.
- DEFAULT, TOWN, NATION & ALLIANCE types are still formatted by Towny when modify_chat.enable is false.
- Closes: https://github.com/TownyAdvanced/Towny/issues/3568
@@ -124,10 +124,15 @@ public class StandardChannel extends Channel {
Format = PlaceholderAPI.setPlaceholders(player, Format); Format = PlaceholderAPI.setPlaceholders(player, Format);
} }
event.setFormat(Format.replace("{channelTag}", getChannelTag()).replace("{msgcolour}", getMessageColour())); /*
* Only modify GLOBAL channelType chat (general and local chat channels) if isModifyChat() is true.
*/
if (!(exec.equals(channelTypes.GLOBAL) && !ChatSettings.isModify_chat())) {
event.setFormat(Format.replace("{channelTag}", getChannelTag()).replace("{msgcolour}", getMessageColour()));
LocalTownyChatEvent chatEvent = new LocalTownyChatEvent(event, resident); LocalTownyChatEvent chatEvent = new LocalTownyChatEvent(event, resident);
event.setFormat(TownyChatFormatter.getChatFormat(chatEvent)); event.setFormat(TownyChatFormatter.getChatFormat(chatEvent));
}
/* /*
* Set all the listeners for Bukkit to send this message to. * Set all the listeners for Bukkit to send this message to.
@@ -137,9 +137,9 @@ public enum ChatConfigNodes {
MODIFY_CHAT_ENABLE( MODIFY_CHAT_ENABLE(
"modify_chat.enable", "modify_chat.enable",
"true", "true",
"# This is used for when you don't have another plugin to format chat.", "# When true Towny will format all ChannelTypes,",
"# or you want some other plugin to handle open chat, but want Towny formatting.", "# When false Towny will only format TOWN, NATION, ALLIANCE, DEFAULT types.",
"# It will cause Towny to overwrite any other plugins alterations to the format."), "# When false Towny will not format GLOBAL types, leaving other chat plugins to do the work."),
MODIFY_CHAT_PER_WORLD( MODIFY_CHAT_PER_WORLD(
"modify_chat.per_world", "modify_chat.per_world",
"false", "false",