diff --git a/src/main/java/net/minestom/server/command/CommandSender.java b/src/main/java/net/minestom/server/command/CommandSender.java index 589edbf21..93e218d5c 100644 --- a/src/main/java/net/minestom/server/command/CommandSender.java +++ b/src/main/java/net/minestom/server/command/CommandSender.java @@ -55,17 +55,17 @@ public interface CommandSender { /** * Checks if the given permission is possessed by this command sender. - * Simple shortcut to
getAllPermissions().contains(permission)
for readability. + * Simple shortcut to
getAllPermissions().contains(permission) && permission.isValidFor(this)
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