Add withPermission(String) to Arguments
See original GitHub issuePlease describe your suggestion A clear and concise description of what the suggestion is.
Please add withPermission(String) to the Argument class. Every single time I use withPermission in my code, I have to include CommandPermission.fromString() as well, which is just very verbose. Having a convenience method in the Argument class that quietly does this conversion for me would make my code much more readable
Please supply examples of the desired inputs and outputs
arguments.add(new PlayerArgument("player").withPermission(CommandPermission.fromString(Perm.MAXHEALTH_OTHER)));
would become
arguments.add(new PlayerArgument("player").withPermission(Perm.MAXHEALTH_OTHER));
which is much more readable and contains only the useful code.
Just want something like this in Argument class
public final Argument withPermission(String permissionString) { return this.withPermission(CommandPermission.fromString(permissionString)); }
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)

Top Related StackOverflow Question
Sure thing, can do 👍
@469512345 Version 5.1 of the CommandAPI has been released.