Package dev.polv.taleapi.event.player
Class PermissionCheckCallback.CheckResult
java.lang.Object
dev.polv.taleapi.event.player.PermissionCheckCallback.CheckResult
- Enclosing interface:
- PermissionCheckCallback
Represents the result of a permission check callback.
Use the static factory methods to create instances:
unmodified()- Keep the original resultallow()- Override to ALLOWdeny()- Override to DENYoverride(PermissionResult)- Override with a custom result
-
Method Summary
Modifier and TypeMethodDescriptionallow()Creates a result that overrides with ALLOW.Creates a result that overrides with ALLOW and a payload.deny()Creates a result that overrides with DENY.Creates a result that overrides with DENY and a payload.Returns the permission result.booleanReturns whether this result modifies the permission.of(PermissionResult result) Creates a result that wraps an existing permission result without modification.override(PermissionResult result) Creates a result that overrides with a custom permission result.Creates a result that keeps the original permission result.
-
Method Details
-
unmodified
Creates a result that keeps the original permission result.- Returns:
- an unmodified check result
-
of
Creates a result that wraps an existing permission result without modification.- Parameters:
result- the permission result to wrap- Returns:
- a check result containing the given permission result
-
allow
Creates a result that overrides with ALLOW.- Returns:
- an allow check result
-
allow
Creates a result that overrides with ALLOW and a payload.- Parameters:
payload- the dynamic value- Returns:
- an allow check result with payload
-
deny
Creates a result that overrides with DENY.- Returns:
- a deny check result
-
deny
Creates a result that overrides with DENY and a payload.- Parameters:
payload- the dynamic value- Returns:
- a deny check result with payload
-
override
Creates a result that overrides with a custom permission result.- Parameters:
result- the permission result to use- Returns:
- a modified check result
-
isModified
public boolean isModified()Returns whether this result modifies the permission.- Returns:
trueif the result was modified
-
getResult
Returns the permission result.- Returns:
- the permission result (may be null if unmodified and no prior result)
-