15.02.2016, 14:36
@dusk: I added your suggestion today to shoebill-common version 1.3-SNAPSHOT (new). You can take a look at the build and the commit here: http://ci.gtaun.net/job/shoebill-common/149/
A few other things have changed:
- The UsageMessageSupplier is now simplified and only supplies you with the player, the prefix and the CommandEntry object which allows you to access all the information of the command.
- The .getParamNames() has moved into the .getParameters() method.
Something to note:
- Shoebill will automatically create a CommandParameter annotation with the variable name as the name if no annotation was provided. Everything that is related to working with the command's parameters is now related to the @CommandParameter annotation. It is guaranteed that this array will never be null.
But this is how to use the @CommandParameter annotation for custom naming and describing parameters:
Shoebill's new default usage message supplier will show the name that has been given in the CommandParameter annotation by default. So in this example the usage message would look like this: "Usage /adminvehicle [Model ID]". The description is not used by default from Shoebill but you can make your own usage message supplier that makes use of the description. Every parameter should only use one @CommandParameter.
Btw: You can leave the description out if you don't want to use a description. This will shorten the line.
A few other things have changed:
- The UsageMessageSupplier is now simplified and only supplies you with the player, the prefix and the CommandEntry object which allows you to access all the information of the command.
- The .getParamNames() has moved into the .getParameters() method.
Something to note:
- Shoebill will automatically create a CommandParameter annotation with the variable name as the name if no annotation was provided. Everything that is related to working with the command's parameters is now related to the @CommandParameter annotation. It is guaranteed that this array will never be null.
But this is how to use the @CommandParameter annotation for custom naming and describing parameters:
PHP код:
@Command
public boolean adminvehicle(Player player,
@CommandParameter(name = "Model ID", description = "The model id of the vehicle that should be created.") int vehId) {
...
return true;
}
Btw: You can leave the description out if you don't want to use a description. This will shorten the line.