Merge pull request #20 from creatorfromhell/patch-1

Fix async/sync issue.
This commit is contained in:
LlmDl authored and GitHub committed 2019-06-13 08:27:17 -05:00
commit 04de974e28
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;
}
}
}