Interface PermissionLevelResult

All Superinterfaces:
PermissionResult

@Immutable public interface PermissionLevelResult extends PermissionResult
A PermissionResult that also contains the permission level that was required for the permission check to pass.
  • Method Details

    • of

      static @NonNull PermissionLevelResult of(boolean result, @NonNull Permission permission, @NonNull net.minecraft.server.permissions.PermissionLevel requiredPermissionLevel)
      Creates a new PermissionLevelResult.
      Parameters:
      result - true if the command may be executed, false otherwise
      permission - permission that this result came from
      requiredPermissionLevel - minecraft permission level that was required for the permission check to pass
      Returns:
      the created result
    • allowed

      boolean allowed()
      Specified by:
      allowed in interface PermissionResult
    • permission

      @NonNull Permission permission()
      Specified by:
      permission in interface PermissionResult
    • requiredPermissionLevel

      @NonNull net.minecraft.server.permissions.PermissionLevel requiredPermissionLevel()
      Returns the minecraft permission level that was required for the permission lookup to return true.
      Returns:
      the required permission level