mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-04 06:28:57 +00:00
fix: change listener event priority
This commit is contained in:
2 files changed
+4
-1
No files matched your search
@@ -15,6 +15,9 @@ import java.util.WeakHashMap;
|
|||||||
|
|
||||||
public class ChatEventProcess {
|
public class ChatEventProcess {
|
||||||
public static void processChatEvent(AsyncChatEvent e, WeakHashMap<Player, String> directedChat) {
|
public static void processChatEvent(AsyncChatEvent e, WeakHashMap<Player, String> directedChat) {
|
||||||
|
if (e.isCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
|
|
||||||
// Save the message
|
// Save the message
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class TownyChatPlayerListener implements Listener {
|
|||||||
plugin.getChannelsHandler().getAllChannels().values().forEach(channel -> channel.forgetPlayer(p));
|
plugin.getChannelsHandler().getAllChannels().values().forEach(channel -> channel.forgetPlayer(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW)
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
public void onPlayerChat(AsyncChatEvent e) {
|
public void onPlayerChat(AsyncChatEvent e) {
|
||||||
ChatEventProcess.processChatEvent(e, directedChat);
|
ChatEventProcess.processChatEvent(e, directedChat);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user