mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-03 14:38:56 +00:00
Merge pull request #20 from creatorfromhell/patch-1
Fix async/sync issue.
This commit is contained in:
2 files changed
+4
-4
No files matched your search
@@ -122,7 +122,7 @@ public class StandardChannel extends Channel {
|
||||
event.getRecipients().addAll(recipients);
|
||||
|
||||
if (isHooked()) {
|
||||
AsyncChatHookEvent hookEvent = new AsyncChatHookEvent(event, this);
|
||||
AsyncChatHookEvent hookEvent = new AsyncChatHookEvent(event, this, !Bukkit.getServer().isPrimaryThread());
|
||||
Bukkit.getServer().getPluginManager().callEvent(hookEvent);
|
||||
if (hookEvent.isCancelled()) {
|
||||
event.setCancelled(true);
|
||||
|
||||
@@ -32,8 +32,8 @@ public class AsyncChatHookEvent extends Event {
|
||||
protected boolean changed;
|
||||
protected Channel channel;
|
||||
|
||||
public AsyncChatHookEvent(AsyncPlayerChatEvent event, Channel channel) {
|
||||
super(true);
|
||||
public AsyncChatHookEvent(AsyncPlayerChatEvent event, Channel channel, boolean async) {
|
||||
super(async);
|
||||
this.event = event;
|
||||
this.changed = false;
|
||||
this.channel = channel;
|
||||
@@ -110,4 +110,4 @@ public class AsyncChatHookEvent extends Event {
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user