Unload before reloading when switching config
This commit is contained in:
parent
b1fba623d2
commit
134df829c7
|
@ -0,0 +1,23 @@
|
|||
package me.rigamortis.seppuku.impl.command;
|
||||
|
||||
import me.rigamortis.seppuku.Seppuku;
|
||||
import me.rigamortis.seppuku.api.command.Command;
|
||||
|
||||
public final class ConfigCommand extends Command {
|
||||
public ConfigCommand() {
|
||||
super("Config", new String[]{"Conf"}, "Change the active config", "Config <config>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exec(String input) {
|
||||
if (!this.clamp(input, 2, 2)) {
|
||||
this.printUsage();
|
||||
return;
|
||||
}
|
||||
|
||||
final String[] split = input.split(" ");
|
||||
final String config = split[1];
|
||||
Seppuku.INSTANCE.getConfigManager().switchToConfig(config);
|
||||
Seppuku.INSTANCE.logChat("\247c" + "Switched to config " + config);
|
||||
}
|
||||
}
|
|
@ -33,6 +33,7 @@ public final class ConfigManager {
|
|||
this.saveAll();
|
||||
|
||||
this.activeConfig = config;
|
||||
Seppuku.INSTANCE.unload();
|
||||
Seppuku.INSTANCE.reload();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue