diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java index a895ecfc5..79b3ec360 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java @@ -501,15 +501,16 @@ public class PlotSquared { log(C.PREFIX.s() + "&cIt's really recommended to run Java 1.8, as it increases performance"); } TASK = IMP.getTaskManager(); - if (Settings.KILL_ROAD_MOBS) { - IMP.runEntityTask(); - } if (C.ENABLED.s().length() > 0) { log(C.ENABLED.s()); } setupConfigs(); setupDefaultFlags(); setupDatabase(); + // Tasks + if (Settings.KILL_ROAD_MOBS) { + IMP.runEntityTask(); + } // Events IMP.registerCommands(); IMP.registerPlayerEvents(); @@ -550,6 +551,7 @@ public class PlotSquared { // Copy files copyFile("town.template"); copyFile("skyblock.template"); + showDebug(); } public void copyFile(String file) { @@ -595,7 +597,7 @@ public class PlotSquared { connection.close(); mySQL.closeConnection(); } catch (NullPointerException | SQLException e) { - if (connection != null) { + if (mySQL != null) { log("&cCould not close mysql connection!"); } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java index f8d5e39b2..c16d1cfab 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -110,7 +110,7 @@ import com.intellectualcrafters.plot.util.bukkit.UUIDHandler; public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotListener implements Listener { @EventHandler - public void onRedstoneEvent(BlockRedstoneEvent event) { + public static void onRedstoneEvent(BlockRedstoneEvent event) { Block block = event.getBlock(); Location loc = BukkitUtil.getLocation(block.getLocation()); if (!isPlotWorld(loc.getWorld())) { @@ -159,9 +159,9 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi } event.setNewCurrent(0); } - + @EventHandler - public void onPhysicsEvent(BlockPhysicsEvent event) { + public static void onPhysicsEvent(BlockPhysicsEvent event) { Block block = event.getBlock(); Location loc = BukkitUtil.getLocation(block.getLocation()); if (!isPlotWorld(loc.getWorld())) {