From 471084a9ef3f07ed47be0260758dd50bbecb5122 Mon Sep 17 00:00:00 2001 From: Luck Date: Sat, 20 Aug 2016 16:29:59 +0100 Subject: [PATCH] Fix NPE --- .../java/me/lucko/luckperms/LPBukkitPlugin.java | 16 ++++++++-------- .../java/me/lucko/luckperms/LPBungeePlugin.java | 16 ++++++++-------- .../java/me/lucko/luckperms/LPSpongePlugin.java | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/LPBukkitPlugin.java b/bukkit/src/main/java/me/lucko/luckperms/LPBukkitPlugin.java index 6589f405..545d374a 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/LPBukkitPlugin.java +++ b/bukkit/src/main/java/me/lucko/luckperms/LPBukkitPlugin.java @@ -92,14 +92,6 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin { trackManager = new TrackManager(); importer = new Importer(commandManager); - // Run update task to refresh any online users - getLog().info("Scheduling Update Task to refresh any online users."); - try { - new UpdateTask(this).run(); - } catch (Exception e) { - e.printStackTrace(); - } - int mins = getConfiguration().getSyncTime(); if (mins > 0) { long ticks = mins * 60 * 20; @@ -128,6 +120,14 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin { LuckPerms.registerProvider(apiProvider); getServer().getServicesManager().register(LuckPermsApi.class, apiProvider, this, ServicePriority.Normal); + // Run update task to refresh any online users + getLog().info("Scheduling Update Task to refresh any online users."); + try { + new UpdateTask(this).run(); + } catch (Exception e) { + e.printStackTrace(); + } + getLog().info("Successfully loaded."); } diff --git a/bungee/src/main/java/me/lucko/luckperms/LPBungeePlugin.java b/bungee/src/main/java/me/lucko/luckperms/LPBungeePlugin.java index da785968..39b59411 100644 --- a/bungee/src/main/java/me/lucko/luckperms/LPBungeePlugin.java +++ b/bungee/src/main/java/me/lucko/luckperms/LPBungeePlugin.java @@ -88,14 +88,6 @@ public class LPBungeePlugin extends Plugin implements LuckPermsPlugin { trackManager = new TrackManager(); importer = new Importer(commandManager); - // Run update task to refresh any online users - getLog().info("Scheduling Update Task to refresh any online users."); - try { - new UpdateTask(this).run(); - } catch (Exception e) { - e.printStackTrace(); - } - int mins = getConfiguration().getSyncTime(); if (mins > 0) { getProxy().getScheduler().schedule(this, new UpdateTask(this), mins, mins, TimeUnit.MINUTES); @@ -109,6 +101,14 @@ public class LPBungeePlugin extends Plugin implements LuckPermsPlugin { apiProvider = new ApiProvider(this); LuckPerms.registerProvider(apiProvider); + // Run update task to refresh any online users + getLog().info("Scheduling Update Task to refresh any online users."); + try { + new UpdateTask(this).run(); + } catch (Exception e) { + e.printStackTrace(); + } + getLog().info("Successfully loaded."); } diff --git a/sponge/src/main/java/me/lucko/luckperms/LPSpongePlugin.java b/sponge/src/main/java/me/lucko/luckperms/LPSpongePlugin.java index ef5e10ea..edf168f3 100644 --- a/sponge/src/main/java/me/lucko/luckperms/LPSpongePlugin.java +++ b/sponge/src/main/java/me/lucko/luckperms/LPSpongePlugin.java @@ -115,14 +115,6 @@ public class LPSpongePlugin implements LuckPermsPlugin { trackManager = new TrackManager(); importer = new Importer(commandManager); - // Run update task to refresh any online users - getLog().info("Scheduling Update Task to refresh any online users."); - try { - new UpdateTask(this).run(); - } catch (Exception e) { - e.printStackTrace(); - } - int mins = getConfiguration().getSyncTime(); if (mins > 0) { scheduler.createTaskBuilder().async().interval(mins, TimeUnit.MINUTES).execute(new UpdateTask(this)) @@ -137,6 +129,14 @@ public class LPSpongePlugin implements LuckPermsPlugin { LuckPerms.registerProvider(apiProvider); Sponge.getServiceManager().setProvider(this, LuckPermsApi.class, apiProvider); + // Run update task to refresh any online users + getLog().info("Scheduling Update Task to refresh any online users."); + try { + new UpdateTask(this).run(); + } catch (Exception e) { + e.printStackTrace(); + } + getLog().info("Successfully loaded."); }