Fix other name permission check if admin permission is set

Also explicitly check for star permission to be compatible with no/non-wildcard permission plugin setups
This commit is contained in:
Phoenix616 2020-02-07 02:47:54 +01:00
parent eb6a45c317
commit 5ee8fc1cf8

View File

@ -48,11 +48,7 @@ public enum Permission {
}
public static boolean otherName(Player player, String name) {
if (has(player, Permission.ADMIN)) {
return false;
}
return hasPermissionSet(player, OTHER_NAME + name) || hasPermissionSet(player, OTHER_NAME + name.toLowerCase());
return hasPermissionSet(player, OTHER_NAME + "*") || hasPermissionSet(player, OTHER_NAME + name) || hasPermissionSet(player, OTHER_NAME + name.toLowerCase());
}
private static boolean hasPermissionSet(CommandSender sender, String permission) {