mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-12-29 12:37:40 +01:00
Fix sponge startup exception
This commit is contained in:
parent
c0a0239eeb
commit
8b83a1d9a2
@ -116,28 +116,23 @@ public class LPSpongePlugin implements LuckPermsPlugin {
|
|||||||
trackManager = new TrackManager();
|
trackManager = new TrackManager();
|
||||||
importer = new Importer(commandManager);
|
importer = new Importer(commandManager);
|
||||||
|
|
||||||
int mins = getConfiguration().getSyncTime();
|
|
||||||
if (mins > 0) {
|
|
||||||
scheduler.createTaskBuilder().async().interval(mins, TimeUnit.MINUTES).execute(new UpdateTask(this))
|
|
||||||
.submit(LPSpongePlugin.this);
|
|
||||||
}
|
|
||||||
|
|
||||||
scheduler.createTaskBuilder().intervalTicks(1L).execute(SpongeSenderFactory.get()).submit(this);
|
|
||||||
scheduler.createTaskBuilder().async().intervalTicks(60L).execute(new ExpireTemporaryTask(this)).submit(this);
|
|
||||||
|
|
||||||
getLog().info("Registering API...");
|
getLog().info("Registering API...");
|
||||||
apiProvider = new ApiProvider(this);
|
apiProvider = new ApiProvider(this);
|
||||||
LuckPerms.registerProvider(apiProvider);
|
LuckPerms.registerProvider(apiProvider);
|
||||||
Sponge.getServiceManager().setProvider(this, LuckPermsApi.class, apiProvider);
|
Sponge.getServiceManager().setProvider(this, LuckPermsApi.class, apiProvider);
|
||||||
|
|
||||||
// Run update task to refresh any online users
|
int mins = getConfiguration().getSyncTime();
|
||||||
getLog().info("Scheduling Update Task to refresh any online users.");
|
if (mins > 0) {
|
||||||
try {
|
scheduler.createTaskBuilder().async().interval(mins, TimeUnit.MINUTES).execute(new UpdateTask(this))
|
||||||
new UpdateTask(this).run();
|
.submit(LPSpongePlugin.this);
|
||||||
} catch (Exception e) {
|
} else {
|
||||||
e.printStackTrace();
|
// Update online users
|
||||||
|
runUpdateTask();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scheduler.createTaskBuilder().intervalTicks(1L).execute(SpongeSenderFactory.get()).submit(this);
|
||||||
|
scheduler.createTaskBuilder().async().intervalTicks(60L).execute(new ExpireTemporaryTask(this)).submit(this);
|
||||||
|
|
||||||
getLog().info("Successfully loaded.");
|
getLog().info("Successfully loaded.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user