From 287932d53027983905976be7e9bb98f2e9ecb6ba Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 21 Feb 2020 14:24:07 +1300 Subject: [PATCH] Fix wrong order loading --- src/main/java/me/libraryaddict/disguise/LibsDisguises.java | 4 ++-- .../disguise/utilities/reflection/asm/WatcherSanitizer.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/LibsDisguises.java b/src/main/java/me/libraryaddict/disguise/LibsDisguises.java index 2b4a29df..2582867b 100644 --- a/src/main/java/me/libraryaddict/disguise/LibsDisguises.java +++ b/src/main/java/me/libraryaddict/disguise/LibsDisguises.java @@ -30,12 +30,12 @@ public class LibsDisguises extends JavaPlugin { @Override public void onLoad() { + instance = this; + if (Bukkit.getServer().getWorlds().isEmpty()) { return; } - instance = this; - WatcherSanitizer.init(); reloaded = true; diff --git a/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/WatcherSanitizer.java b/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/WatcherSanitizer.java index d3e86efa..ad0db887 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/WatcherSanitizer.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/reflection/asm/WatcherSanitizer.java @@ -47,7 +47,7 @@ public class WatcherSanitizer { PluginDescriptionFile desc = (PluginDescriptionFile) dF.get(loader); - DisguiseUtilities.getLogger().severe(desc.getFullName() + + LibsDisguises.getInstance().getLogger().severe(desc.getFullName() + " has been a naughty plugin, they're declaring access to the disguise watchers before Lib's " + "Disguises can properly load them! They should add 'LibsDisguises' to the 'depend' section of" + " their plugin.yml!");