A fix and another
This commit is contained in:
parent
25b9caa903
commit
c62424389f
2 changed files with 4 additions and 1 deletions
|
@ -93,6 +93,7 @@ public class MainPlugin extends ButtonPlugin {
|
||||||
Component.registerComponent(this, new VotifierComponent(economy));
|
Component.registerComponent(this, new VotifierComponent(economy));
|
||||||
ComponentManager.enableComponents();
|
ComponentManager.enableComponents();
|
||||||
getCommand2MC().registerCommand(new ComponentCommand());
|
getCommand2MC().registerCommand(new ComponentCommand());
|
||||||
|
getCommand2MC().registerCommand(new ThorpeCommand());
|
||||||
TBMCCoreAPI.RegisterEventsForExceptions(new PlayerListener(), this);
|
TBMCCoreAPI.RegisterEventsForExceptions(new PlayerListener(), this);
|
||||||
ChromaGamerBase.addConverter(commandSender -> Optional.ofNullable(commandSender instanceof ConsoleCommandSender || commandSender instanceof BlockCommandSender
|
ChromaGamerBase.addConverter(commandSender -> Optional.ofNullable(commandSender instanceof ConsoleCommandSender || commandSender instanceof BlockCommandSender
|
||||||
? TBMCPlayer.getPlayer(new UUID(0, 0), TBMCPlayer.class) : null)); //Console & cmdblocks
|
? TBMCPlayer.getPlayer(new UUID(0, 0), TBMCPlayer.class) : null)); //Console & cmdblocks
|
||||||
|
|
|
@ -19,6 +19,7 @@ public abstract class ButtonPlugin extends JavaPlugin {
|
||||||
private IHaveConfig iConfig;
|
private IHaveConfig iConfig;
|
||||||
@Getter(AccessLevel.PROTECTED)
|
@Getter(AccessLevel.PROTECTED)
|
||||||
private IHaveConfig data; //TODO
|
private IHaveConfig data; //TODO
|
||||||
|
private boolean loaded = false;
|
||||||
/**
|
/**
|
||||||
* Used to unregister components in the right order - and to reload configs
|
* 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() {
|
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).");
|
getLogger().warning("Saved pending configuration changes to the file, didn't reload (try again).");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
super.reloadConfig();
|
super.reloadConfig();
|
||||||
|
loaded = true; //Needed because for the first time it uses reloadConfig() to load it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue