//Add new instance of Commands Module to registerModules method in configure method
@Override
protected LibraryConfiguration configure() {
commandsModule = new CommandsModule(this);
//or use your own command configurator
commandsModule = new CommandsModule(this, new MyCommandConfigurator());
return new LibraryConfiguration(this, getConfiguratorsInitializer())
.builder()
.setGameManager(new MyGameManager(this, settings, messages))
.registerModules(commandsModule) //new way how to register command module
.build();
}
How to define command configurator?
public class MyCommandConfigurator extends DefaultCommandConfigurator {
@Override
public CommandConfiguration configure() {
return CommandConfiguration.builder()
.doNotHavePermissionMessage("No permission")
.onlyPlayersMessage("Only players can use this command")
.build();
}
}