- Fire chat Async so it matches all other chat.
This commit is contained in:
ElgarL committed 2013-04-02 16:12:41 +01:00
1 parent 3fb6dc5df3
commit ffafc8c66e
2 files changed
+17 -3

No files matched your search

+4 -1
View File
@@ -171,4 +171,7 @@ v0.36:
permission: townychat.mod.unmute
v0.37:
- Remove mute alias on 'chmute' So TownyChat does not block Essentials mute.
- Remove mute alias on 'chmute' So TownyChat does not block Essentials mute.
v0.38:
- Fire chat Async so it matches all other chat.
@@ -72,7 +72,7 @@ public class TownyChatPlayerListener implements Listener {
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
Player player = event.getPlayer();
final Player player = event.getPlayer();
// Test if this player is registered with Towny.
try {
@@ -137,7 +137,18 @@ public class TownyChatPlayerListener implements Listener {
event.setMessage(message);
directedChat.put(player, command);
player.chat(message);
final String msg = message;
// Fire this Async so we match other incoming chat.
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
player.chat(msg);
}});
}
event.setCancelled(true);