Fix sponge startup exception

This commit is contained in:
Luck 2016-08-24 22:38:52 +01:00
parent c0a0239eeb
commit 8b83a1d9a2
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -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.");
} }