mirror of
https://github.com/BentoBoxWorld/AcidIsland.git
synced 2024-11-23 02:55:21 +01:00
Added reloading.
This commit is contained in:
parent
2b3ee0997f
commit
a744ad8675
@ -32,11 +32,21 @@ public class AcidIsland extends GameModeAddon {
|
||||
public void onLoad() {
|
||||
saveDefaultConfig();
|
||||
// Load settings
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
private boolean loadSettings() {
|
||||
settings = new Config<>(this, AISettings.class).loadConfigObject();
|
||||
if (settings == null) {
|
||||
// Woops
|
||||
this.logError("Settings could not load! Addon disabled.");
|
||||
this.logError("AcidIsland settings could not load! Addon disabled.");
|
||||
this.setState(State.DISABLED);
|
||||
if (acidTask != null) {
|
||||
acidTask.cancelTasks();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -118,4 +128,11 @@ public class AcidIsland extends GameModeAddon {
|
||||
return settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReload() {
|
||||
if (loadSettings()) {
|
||||
log("Reloaded AcidIsland settings");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,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;
|
||||
@ -62,8 +63,10 @@ public class AcidCommand 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