mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-02 06:28:58 +00:00
- 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:
1 parent
da0cf7c4a2
commit
0b705e4742
3 files changed
+10
-3
No files matched your search
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user