use of com.denizenscript.denizen.events.BukkitScriptEvent in project Denizen-For-Bukkit by DenizenScript.
the class ListPingScriptEvent method syncFire.
public void syncFire(ServerListPingEvent event) {
this.event = event;
if (!Bukkit.isPrimaryThread()) {
BukkitScriptEvent altEvent = (BukkitScriptEvent) clone();
Future future = Bukkit.getScheduler().callSyncMethod(Denizen.getInstance(), () -> {
altEvent.fire();
return null;
});
try {
future.get(5, TimeUnit.SECONDS);
} catch (Throwable ex) {
Debug.echoError(ex);
}
return;
}
fire(event);
}
Aggregations