mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-03 23:17:48 +01:00
Fixed inconsistency between hasPermission(Permission) and hasPermission(Class)
This commit is contained in:
parent
1772b94114
commit
4782d6e899
@ -55,17 +55,17 @@ public interface CommandSender {
|
||||
|
||||
/**
|
||||
* Checks if the given permission is possessed by this command sender.
|
||||
* Simple shortcut to <pre>getAllPermissions().contains(permission)</pre> for readability.
|
||||
* Simple shortcut to <pre>getAllPermissions().contains(permission) && permission.isValidFor(this)</pre> for readability.
|
||||
* @param p permission to check against
|
||||
* @return
|
||||
*/
|
||||
default boolean hasPermission(Permission p) {
|
||||
return getAllPermissions().contains(p);
|
||||
return getAllPermissions().contains(p) && p.isValidFor(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given permission is possessed by this command sender.
|
||||
* Will call {@link #hasPermission(Permission)} on all permissions that are an instance of permissionClass.
|
||||
* Will call {@link Permission#isValidFor(Permission)} on all permissions that are an instance of permissionClass.
|
||||
* If no matching permission is found, this result returns false.
|
||||
*
|
||||
* @param permissionClass
|
||||
|
Loading…
Reference in New Issue
Block a user