- Allow for players to use !message to send chat to a Global channel.

- Will not work when chat is being directed to a channel, ie: /nc
!chat message.
This commit is contained in:
LlmDl committed 2022-11-08 11:15:39 -06:00
1 parent da0cf7c4a2
commit 0b705e4742
3 files changed
+10 -3

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.98</version>
<version>0.99</version>
<licenses>
<license>
+4 -1
View File
@@ -422,4 +422,7 @@ v0.98:
- Replace TownyChatReplacerCallable with TownyChatReplacer.
- Makes use of Functions to do what the old Callable did.
- Refactor a bunch of the plugin to get rid of old/ugly code.
- There is a chance that some 3rd party chat plugins will break. Let me know about this asap.
- There is a chance that some 3rd party chat plugins will break. Let me know about this asap.
v0.99:
- Allow for players to use !message to send chat to a Global channel.
- Will not work when chat is being directed to a channel, ie: /nc !chat message.
@@ -71,6 +71,8 @@ public class TownyChatPlayerListener implements Listener {
// Check if essentials has this player muted.
if (!isEssentialsMuted(player)) {
boolean forceGlobal = event.getMessage().startsWith("!");
/*
* If this was directed chat send it via the relevant channel
@@ -96,7 +98,7 @@ public class TownyChatPlayerListener implements Listener {
* Check the player for any channel modes.
*/
Channel channel = plugin.getPlayerChannel(player);
if (channel != null) {
if (!forceGlobal && channel != null) {
if (isMutedOrSpam(event, channel, player))
return;
channel.chatProcess(event);
@@ -110,6 +112,8 @@ public class TownyChatPlayerListener implements Listener {
if (channel != null) {
if (isMutedOrSpam(event, channel, player))
return;
if (forceGlobal)
event.setMessage(event.getMessage().substring(1));
channel.chatProcess(event);
return;
}