mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-04 06:28:57 +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
+9
-2
No files matched your search
@@ -7,7 +7,7 @@
|
|||||||
<groupId>com.palmergames.bukkit</groupId>
|
<groupId>com.palmergames.bukkit</groupId>
|
||||||
<artifactId>TownyChat</artifactId>
|
<artifactId>TownyChat</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>0.98</version>
|
<version>0.99</version>
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
|
|||||||
@@ -423,3 +423,6 @@ v0.98:
|
|||||||
- Makes use of Functions to do what the old Callable did.
|
- Makes use of Functions to do what the old Callable did.
|
||||||
- Refactor a bunch of the plugin to get rid of old/ugly code.
|
- 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.
|
||||||
@@ -72,6 +72,8 @@ public class TownyChatPlayerListener implements Listener {
|
|||||||
// Check if essentials has this player muted.
|
// Check if essentials has this player muted.
|
||||||
if (!isEssentialsMuted(player)) {
|
if (!isEssentialsMuted(player)) {
|
||||||
|
|
||||||
|
boolean forceGlobal = event.getMessage().startsWith("!");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this was directed chat send it via the relevant channel
|
* 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.
|
* Check the player for any channel modes.
|
||||||
*/
|
*/
|
||||||
Channel channel = plugin.getPlayerChannel(player);
|
Channel channel = plugin.getPlayerChannel(player);
|
||||||
if (channel != null) {
|
if (!forceGlobal && channel != null) {
|
||||||
if (isMutedOrSpam(event, channel, player))
|
if (isMutedOrSpam(event, channel, player))
|
||||||
return;
|
return;
|
||||||
channel.chatProcess(event);
|
channel.chatProcess(event);
|
||||||
@@ -110,6 +112,8 @@ public class TownyChatPlayerListener implements Listener {
|
|||||||
if (channel != null) {
|
if (channel != null) {
|
||||||
if (isMutedOrSpam(event, channel, player))
|
if (isMutedOrSpam(event, channel, player))
|
||||||
return;
|
return;
|
||||||
|
if (forceGlobal)
|
||||||
|
event.setMessage(event.getMessage().substring(1));
|
||||||
channel.chatProcess(event);
|
channel.chatProcess(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user