use of com.karanumcoding.adamantineshield.commands.arguments.TimeStringArgument in project AdamantineShield by Karanum.
the class AdamantineShield method registerCommands.
private void registerCommands(CommandManager man) {
CommandSpec filterCommand = CommandSpec.builder().permission(Permissions.FILTER.get()).arguments(GenericArguments.allOf(GenericArguments.string(Text.of("filter")))).executor(new CommandFilter(this)).build();
CommandSpec helpCommand = CommandSpec.builder().executor(new CommandMain()).build();
CommandSpec inspectCommand = CommandSpec.builder().permission(Permissions.LOOKUP.get()).executor(new CommandInspect(this)).build();
CommandSpec lookupCommand = CommandSpec.builder().permission(Permissions.LOOKUP.get()).arguments(GenericArguments.allOf(GenericArguments.string(Text.of("filter")))).executor(new CommandLookup(this)).build();
CommandSpec nextPageCommand = CommandSpec.builder().permission(Permissions.LOOKUP.get()).executor(new CommandNextPage()).build();
CommandSpec pageCommand = CommandSpec.builder().permission(Permissions.LOOKUP.get()).arguments(GenericArguments.onlyOne(GenericArguments.integer(Text.of("page")))).executor(new CommandPage()).build();
CommandSpec prevPageCommand = CommandSpec.builder().permission(Permissions.LOOKUP.get()).executor(new CommandPrevPage()).build();
CommandSpec purgeCommand = CommandSpec.builder().permission(Permissions.PURGE.get()).arguments(GenericArguments.onlyOne(new TimeStringArgument(Text.of("time")))).executor(new CommandPurge(this)).build();
// CommandSpec reloadCommand = CommandSpec.builder()
// .permission(Permissions.RELOAD.get())
// .executor(new CommandReload())
// .build();
// CommandSpec rollbackCommand = CommandSpec.builder()
// .permission(Permissions.ROLLBACK.get())
// .arguments(GenericArguments.allOf(GenericArguments.string(Text.of("filter"))))
// .executor(new CommandRollback(this))
// .build();
//
// CommandSpec undoCommand = CommandSpec.builder()
// .permission(Permissions.UNDO.get())
// .arguments(GenericArguments.allOf(GenericArguments.string(Text.of("filter"))))
// .executor(new CommandUndo(this))
// .build();
CommandSpec parentCommand = CommandSpec.builder().description(Text.of("Main command for AdamantineShield")).child(inspectCommand, "inspect", "i").child(lookupCommand, "lookup", "l").child(filterCommand, "filter", "f").child(pageCommand, "page", "p").child(nextPageCommand, "nextpage", "next").child(prevPageCommand, "prevpage", "prev").child(purgeCommand, "purge").child(helpCommand, "help", "?").executor(new CommandMain()).build();
man.register(this, parentCommand, "ashield", "as");
}
Aggregations