This commit is contained in:
parent
40af6b246d
commit
997906cd02
3 changed files with 35 additions and 10 deletions
11
README.md
11
README.md
|
|
@ -1,8 +1,3 @@
|
|||
## TODO
|
||||
|
||||
CI/CD:
|
||||
- actually publish package
|
||||
|
||||
## Build
|
||||
|
||||
after installing bazel:
|
||||
|
|
@ -51,20 +46,18 @@ literal:coins/balance
|
|||
### As code
|
||||
|
||||
```java
|
||||
import de.kentoj.kencommandapi.api.literal.RootLiteral;
|
||||
|
||||
/**
|
||||
* Show the amount coins a user has.
|
||||
* If no user is given, it should show the amount the sender of the command has.
|
||||
*/
|
||||
public class CoinsCommand {
|
||||
public final class CoinsCommand {
|
||||
|
||||
private final RootLiteral<User> rootLiteral;
|
||||
private final CommandArgumentSpec<User, User> userArg;
|
||||
|
||||
public CoinsCommand() {
|
||||
userArg = CommandArgumentSpec.builder("user", new UserArgumentType<User>())
|
||||
.withRequirement(p -> !p.hasPermission("economy.immune.getcoins"),
|
||||
.withRequirement(user -> !user.hasPermission("economy.immune.getcoins"),
|
||||
"you can't see that player's balance")
|
||||
.withDefaultValue(CommandContext::sender)
|
||||
.build();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue