From 2bc4209a6c80f2c432a08fb536319dd392d674f0 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 18 Jan 2020 15:12:32 +1300 Subject: [PATCH] Catch reloads --- .../libraryaddict/disguise/LibsDisguises.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/me/libraryaddict/disguise/LibsDisguises.java b/src/main/java/me/libraryaddict/disguise/LibsDisguises.java index f82c7094..bee17598 100644 --- a/src/main/java/me/libraryaddict/disguise/LibsDisguises.java +++ b/src/main/java/me/libraryaddict/disguise/LibsDisguises.java @@ -36,9 +36,27 @@ public class LibsDisguises extends JavaPlugin { private static LibsDisguises instance; private DisguiseListener listener; private String buildNumber; + private boolean reloaded; + + @Override + public void onLoad() { + if (Bukkit.getServer().getWorlds().isEmpty()) { + return; + } + + reloaded = true; + getLogger().severe("Lib's Disguises was reloaded! Please do not report any bugs! This plugin can't handle " + + "reloads gracefully!"); + } @Override public void onEnable() { + if (reloaded) { + getLogger() + .severe("Lib's Disguises was reloaded! Please do not report any bugs! This plugin can't handle " + + "reloads gracefully!"); + } + instance = this; if (!new File(getDataFolder(), "disguises.yml").exists()) {