Ensure plugin reloaders (or /reload) won't work

This commit is contained in:
filoghost 2020-06-26 10:49:06 +02:00
parent f7fc2f2baa
commit 022040c81f

View File

@ -69,11 +69,13 @@ public class ChestCommands extends JavaPlugin {
@Override
public void onEnable() {
if (instance != null) {
getLogger().warning("Please do not use /reload or plugin reloaders. Do \"/cc reload\" instead.");
if (instance != null || System.getProperty("ChestCommandsLoaded") != null) {
getLogger().warning("Please do not use /reload or plugin reloaders. Use the command \"/cc reload\" instead.");
return;
}
System.setProperty("ChestCommandsLoaded", "true");
instance = this;
menuManager = new MenuManager();
settings = new Settings();