From c62424389fa71e5cd30a70318ac2f047d6435a7c Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 14 Mar 2019 00:40:40 +0100 Subject: [PATCH] A fix and another --- ButtonCore/src/main/java/buttondevteam/core/MainPlugin.java | 1 + .../java/buttondevteam/lib/architecture/ButtonPlugin.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ButtonCore/src/main/java/buttondevteam/core/MainPlugin.java b/ButtonCore/src/main/java/buttondevteam/core/MainPlugin.java index f46a85c..e810c67 100755 --- a/ButtonCore/src/main/java/buttondevteam/core/MainPlugin.java +++ b/ButtonCore/src/main/java/buttondevteam/core/MainPlugin.java @@ -93,6 +93,7 @@ public class MainPlugin extends ButtonPlugin { Component.registerComponent(this, new VotifierComponent(economy)); ComponentManager.enableComponents(); getCommand2MC().registerCommand(new ComponentCommand()); + getCommand2MC().registerCommand(new ThorpeCommand()); TBMCCoreAPI.RegisterEventsForExceptions(new PlayerListener(), this); ChromaGamerBase.addConverter(commandSender -> Optional.ofNullable(commandSender instanceof ConsoleCommandSender || commandSender instanceof BlockCommandSender ? TBMCPlayer.getPlayer(new UUID(0, 0), TBMCPlayer.class) : null)); //Console & cmdblocks diff --git a/ButtonCore/src/main/java/buttondevteam/lib/architecture/ButtonPlugin.java b/ButtonCore/src/main/java/buttondevteam/lib/architecture/ButtonPlugin.java index 3c46b59..e06ab95 100644 --- a/ButtonCore/src/main/java/buttondevteam/lib/architecture/ButtonPlugin.java +++ b/ButtonCore/src/main/java/buttondevteam/lib/architecture/ButtonPlugin.java @@ -19,6 +19,7 @@ public abstract class ButtonPlugin extends JavaPlugin { private IHaveConfig iConfig; @Getter(AccessLevel.PROTECTED) private IHaveConfig data; //TODO + private boolean loaded = false; /** * Used to unregister components in the right order - and to reload configs */ @@ -76,10 +77,11 @@ public abstract class ButtonPlugin extends JavaPlugin { } public void justReload() { - if (ConfigData.saveNow(getConfig())) { + if (loaded && ConfigData.saveNow(getConfig())) { getLogger().warning("Saved pending configuration changes to the file, didn't reload (try again)."); return; } super.reloadConfig(); + loaded = true; //Needed because for the first time it uses reloadConfig() to load it } }