mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-25 12:25:15 +01:00
Workaround Folia for serverStarted
This commit is contained in:
parent
cfcb1bdc26
commit
784d759540
@ -68,6 +68,19 @@ public class DiscordSRVBukkitBootstrap extends BukkitBootstrap implements IBoots
|
||||
@Override
|
||||
public void onEnable() {
|
||||
lifecycleManager.loadAndEnable(() -> this.discordSRV = new BukkitDiscordSRV(this));
|
||||
|
||||
boolean isFolia = false;
|
||||
try {
|
||||
Class.forName("io.papermc.paper.threadedregions.scheduler.GlobalRegionScheduler");
|
||||
isFolia = true;
|
||||
} catch (ClassNotFoundException ignored) {}
|
||||
|
||||
if (isFolia) {
|
||||
discordSRV.invokeServerStarted();
|
||||
return;
|
||||
}
|
||||
|
||||
// Run a task on the main thread 1 tick later, so essentially when the server has finished booting
|
||||
getPlugin().getServer().getScheduler().runTaskLater(getPlugin(), () -> discordSRV.invokeServerStarted(), 1L);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user