Safe disable

Former-commit-id: 16e34b9f401c91c28b9a9fb63a3ac5c76f3c091f [formerly 6a3dcd81b7d0e6e6b89dc264f3457309b269d378]
Former-commit-id: 0b3f60d3115861cf575abc8715b4119aaeb0d179
This commit is contained in:
Sotr committed 2018-10-29 22:26:07 +08:00
1 parent 275a7e69cc
commit fa08b3b9ea
1 file changed
+6 -1
@@ -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();
}