mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-22 10:15:54 +01:00
Call PlayerIslandChatEvent async.
This commit is contained in:
parent
7be512513d
commit
ecbcc0324c
@ -48,13 +48,7 @@ public class ChatListeners implements Listener {
|
||||
|
||||
PlayerIslandChatEvent islandChatEvent = new PlayerIslandChatEvent(player, island.getAPIWrapper(),
|
||||
event.getMessage(), languageLoad.getString("Island.Chat.Format.Message"));
|
||||
|
||||
Runnable callEvent = () -> Bukkit.getServer().getPluginManager().callEvent(islandChatEvent);
|
||||
if (Bukkit.isPrimaryThread()) {
|
||||
callEvent.run();
|
||||
} else {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, callEvent);
|
||||
}
|
||||
Bukkit.getServer().getPluginManager().callEvent(islandChatEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user