- 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
+16 -8

No files matched your search

+4 -1
View File
@@ -287,4 +287,7 @@ v0.65:
- Previously using the channel command for the channel you're already speaking in would move you to the next default channel,
or if non was found, the next global channel.
- 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);
}
event.setFormat(Format.replace("{channelTag}", getChannelTag()).replace("{msgcolour}", getMessageColour()));
LocalTownyChatEvent chatEvent = new LocalTownyChatEvent(event, resident);
event.setFormat(TownyChatFormatter.getChatFormat(chatEvent));
/*
* 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);
event.setFormat(TownyChatFormatter.getChatFormat(chatEvent));
}
/*
* Set all the listeners for Bukkit to send this message to.
@@ -137,9 +137,9 @@ public enum ChatConfigNodes {
MODIFY_CHAT_ENABLE(
"modify_chat.enable",
"true",
"# This is used for when you don't have another plugin to format chat.",
"# or you want some other plugin to handle open chat, but want Towny formatting.",
"# It will cause Towny to overwrite any other plugins alterations to the format."),
"# When true Towny will format all ChannelTypes,",
"# When false Towny will only format TOWN, NATION, ALLIANCE, DEFAULT types.",
"# When false Towny will not format GLOBAL types, leaving other chat plugins to do the work."),
MODIFY_CHAT_PER_WORLD(
"modify_chat.per_world",
"false",