From fa08b3b9ea80a309060f7f53de2ac8d0ac96edf5 Mon Sep 17 00:00:00 2001 From: Sotr Date: Mon, 29 Oct 2018 22:26:07 +0800 Subject: [PATCH] Safe disable Former-commit-id: 16e34b9f401c91c28b9a9fb63a3ac5c76f3c091f [formerly 6a3dcd81b7d0e6e6b89dc264f3457309b269d378] Former-commit-id: 0b3f60d3115861cf575abc8715b4119aaeb0d179 --- src/main/java/org/maxgamer/quickshop/QuickShop.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index 9183274af..2865a5884 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -113,6 +113,7 @@ public class QuickShop extends JavaPlugin { MultiverseCore mPlugin = null; private int displayItemCheckTicks; + private boolean noopDisable; /** The plugin metrics from Hidendra */ // public Metrics getMetrics(){ return metrics; } @@ -146,7 +147,9 @@ public class QuickShop extends JavaPlugin { getLogger().severe("WARNING: QSRR won't start without you confirm, nothing will changes before you turn on dev allowed."); if(!getConfig().getBoolean("dev-mode")){ getLogger().severe("WARNING: Set dev-mode: true in config.yml to allow qs load on dev mode(Maybe need add this line by your self)."); - System.exit(0); + noopDisable = true; + Bukkit.getPluginManager().disablePlugin(this); + return; } } if (loadEcon() == false) @@ -821,6 +824,8 @@ public class QuickShop extends JavaPlugin { } public void onDisable() { + if (noopDisable) + return; if (itemWatcherTask != null) { itemWatcherTask.cancel(); }