How would I go about creating a separate method to register my commands? This is what I have so far:
// I have all of my imports, I just decided not to paste them
@Plugin(id = "me.roboticplayer.helloworld", name = "Hello World", version = "1.0")
public class HelloWorld implements CommandExecutor {
@Listener
public void onInitialization(GameInitializationEvent e) {
registerHello();
}
@Override
public CommandResult execute(CommandSource sender, CommandContext commandcontext) throws CommandException {
// Temporary!
return null;
}
public void registerHello() {
CommandSpec hello = CommandSpec.builder().description(Texts.of("Says hello to the sender!")).executor(this)
.build();
// Right here I want to put something that will actually register the command
// If I were in an event, I could do e.getGame().getCommandDispatcher().register(params)
// But I'm not, and I don't know what methods I can use to get the game/command dispatcher
}
}