- New Config Option: allow_exclamation_point_to_shout

- Default: true
    - If true players that say !somewords will have their message sent
to a global type channel with unlimited range (usually your general
chat.)
This commit is contained in:
LlmDl committed 2023-01-22 09:38:43 -06:00
1 parent 915285a066
commit 238b3cb45a
5 files changed
+20 -4

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
<groupId>com.palmergames.bukkit</groupId>
<artifactId>TownyChat</artifactId>
<packaging>jar</packaging>
<version>0.102</version>
<version>0.103</version>
<licenses>
<license>
+5 -1
View File
@@ -438,4 +438,8 @@ v0.101:
- Update min. Towny version to 0.98.5.0 & replace deprecated methods.
- Fix permission test backing /channel join {channelname}.
v0.102:
- Parse placeholders when we're unable to find a channel to speak into, but modify_chat is true.
- Parse placeholders when we're unable to find a channel to speak into, but modify_chat is true.
v0.103:
- New Config Option: allow_exclamation_point_to_shout
- Default: true
- If true players that say !somewords will have their message sent to a global type channel with unlimited range (usually your general chat.)
@@ -167,7 +167,12 @@ public enum ChatConfigNodes {
"display_channel_join_message_on_joining_the_server",
"true",
"",
"# If true players will see You have joined channel {channel} message on joining the server."),
"# If true players will see You have joined channel {channel} message on joining the server."),
ALLOW_EXCLAMATION_POINT_SHOUTS(
"allow_exclamation_point_to_shout",
"true",
"",
"# If true players that say !somewords will have their message sent to a global type channel with unlimited range (usually your general chat.)"),
WORLDS("worlds","","");
@@ -177,6 +177,13 @@ public class ChatSettings {
return getBoolean(ChatConfigNodes.DISPLAY_CHANNEL_JOIN_MESSAGE_ON_JOIN);
}
/**
* @return true if preceding exclamation points shouts into global channel with unlimited range.
*/
public static boolean isExclamationPoint() {
return getBoolean(ChatConfigNodes.ALLOW_EXCLAMATION_POINT_SHOUTS);
}
/*
* Get Tags formats.
*/
@@ -75,7 +75,7 @@ public class TownyChatPlayerListener implements Listener {
// Check if essentials has this player muted.
if (!isEssentialsMuted(player)) {
boolean forceGlobal = event.getMessage().startsWith("!");
boolean forceGlobal = ChatSettings.isExclamationPoint() && event.getMessage().startsWith("!");
/*
* If this was directed chat send it via the relevant channel