Add SaveCommand

This commit is contained in:
noil 2023-05-17 01:07:56 -04:00
parent 4ca81e4504
commit 607fcb9b8d
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,26 @@
package me.rigamortis.seppuku.impl.command;
import me.rigamortis.seppuku.Seppuku;
import me.rigamortis.seppuku.api.command.Command;
/**
* @author noil
*/
public final class SaveCommand extends Command {
public SaveCommand() {
super("Save", new String[]{"SaveAll"}, "Saves all client settings to disk.", "Save");
}
@Override
public void exec(String input) {
if (!this.clamp(input, 1, 1)) {
this.printUsage();
return;
}
Seppuku.INSTANCE.getConfigManager().saveAll();
Seppuku.INSTANCE.logChat("Saved");
}
}

View File

@ -79,6 +79,7 @@ public final class CommandManager {
this.commandList.add(new NukerFilterCommand());
this.commandList.add(new ExportCommand());
this.commandList.add(new LoadCommand());
this.commandList.add(new SaveCommand());
//create commands for every value within every module
loadValueCommands();