mirror of
https://github.com/BentoBoxWorld/BSkyBlock.git
synced 2024-12-28 17:27:35 +01:00
Adds addon reloading of settings.
This commit is contained in:
parent
bebe65479c
commit
8cb0eba57e
@ -29,7 +29,17 @@ public class BSkyBlock extends GameModeAddon {
|
||||
// Save the default config from config.yml
|
||||
saveDefaultConfig();
|
||||
// Load settings from config.yml. This will check if there are any issues with it too.
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
private void loadSettings() {
|
||||
settings = new Config<>(this, Settings.class).loadConfigObject();
|
||||
if (settings == null) {
|
||||
// Disable
|
||||
logError("BSkyBlock settings could not load! Addon disabled.");
|
||||
setState(State.DISABLED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -47,6 +57,11 @@ public class BSkyBlock extends GameModeAddon {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReload() {
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the settings
|
||||
*/
|
||||
|
@ -9,6 +9,7 @@ import world.bentobox.bentobox.api.commands.admin.AdminDeleteCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminGetrankCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminInfoCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminRegisterCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminReloadCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminSetrankCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminTeleportCommand;
|
||||
import world.bentobox.bentobox.api.commands.admin.AdminUnregisterCommand;
|
||||
@ -63,8 +64,10 @@ public class AdminCommand extends CompositeCommand {
|
||||
new AdminDeleteCommand(this);
|
||||
// Why
|
||||
new AdminWhyCommand(this);
|
||||
|
||||
// Deaths
|
||||
new AdminDeathsCommand(this);
|
||||
// Reload
|
||||
new AdminReloadCommand(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user