Skip to content

Commit

Permalink
Merge pull request JorelAli#523 from Timongcraft/dev/expose-string-pe…
Browse files Browse the repository at this point in the history
…rmission

Exposed details of the CommandPermission
  • Loading branch information
JorelAli authored Feb 26, 2024
2 parents 2875e8a + abda634 commit c1399a1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ This is the current roadmap for the CommandAPI (as of 11th May 2023):
<ul>
<li>https://github.com/JorelAli/CommandAPI/issues/495 Adds a parameter to <code>EntitySelectorArgument</code> to allow failure when no entity lists are empty</li>
<li>https://github.com/JorelAli/CommandAPI/issues/367, https://github.com/JorelAli/CommandAPI/pull/509 Adds the ability to register commands with a custom namespace</li>
<li>https://github.com/JorelAli/CommandAPI/pull/523 Exposed more details of the <code>CommandPermission</code></li>
</ul>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,26 @@ public String toString() {
return (negated ? "not " : "") + result;
}

Optional<String> getPermission() {
/**
* Returns the custom permission in string form if set
*
* @return An {@code Optional<String>} with the custom permission or an empty {@code Optional} if not set
*/
public Optional<String> getPermission() {
return Optional.ofNullable(this.permission);
}

PermissionNode getPermissionNode() {
return this.permissionNode;
/**
* Returns if the permission is negated
*
* @return the permission's negation state
*/
public boolean isNegated() {
return this.negated;
}

boolean isNegated() {
return this.negated;
PermissionNode getPermissionNode() {
return this.permissionNode;
}

CommandPermission negate() {
Expand Down

0 comments on commit c1399a1

Please sign in to comment.