New command system improvements, broadcast toggles, config fixes #62
2 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue