Interface IPlayerPermissionSystemAPI
public interface IPlayerPermissionSystemAPI
The interface to be overridden by addons that wish to implement additional permission systems to be used
by Open Parties and Claims.
Player permission system implementations must be registered in IPlayerPermissionSystemRegisterAPI
.
-
Method Summary
Modifier and TypeMethodDescriptiongetIntPermission
(net.minecraft.server.level.ServerPlayer player, IPermissionNodeAPI<Integer> node) Gets the value of an integer permission for a specified player.boolean
getPermission
(net.minecraft.server.level.ServerPlayer player, IPermissionNodeAPI<Boolean> node) Gets the value of a boolean permission for a specified player.<T> Optional<T>
getPermissionTyped
(net.minecraft.server.level.ServerPlayer player, IPermissionNodeAPI<T> node) Gets the value of a permission with a specific value type.
-
Method Details
-
getIntPermission
@Nonnull OptionalInt getIntPermission(@Nonnull net.minecraft.server.level.ServerPlayer player, @Nonnull IPermissionNodeAPI<Integer> node) Gets the value of an integer permission for a specified player.- Parameters:
player
- the player, not nullnode
- the node of the permission fromUsedPermissionNodes
, not null- Returns:
- the OptionalInt for the int value of the permission, not null
-
getPermission
boolean getPermission(@Nonnull net.minecraft.server.level.ServerPlayer player, @Nonnull IPermissionNodeAPI<Boolean> node) Gets the value of a boolean permission for a specified player.- Parameters:
player
- the player, not nullnode
- the node of the permission fromUsedPermissionNodes
, not null- Returns:
- the boolean value of the permission, false if it doesn't exist
-
getPermissionTyped
@Nonnull <T> Optional<T> getPermissionTyped(@Nonnull net.minecraft.server.level.ServerPlayer player, @Nonnull IPermissionNodeAPI<T> node) Gets the value of a permission with a specific value type.This isn't used by the mod as of typing this, but could be in the future.
- Type Parameters:
T
- the permission value type- Parameters:
player
- the player, not nullnode
- the node of the permission fromUsedPermissionNodes
, not null- Returns:
- the Optional for the value of the permission, not null
-