Class DefaultPermissionHandler
java.lang.Object
net.neoforged.neoforge.server.permission.handler.DefaultPermissionHandler
- All Implemented Interfaces:
 IPermissionHandler
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ResourceLocationprivate Set<PermissionNode<?>>private final Set<PermissionNode<?>> - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionReturns an identifier for the PermissionHandler.<T> TgetOfflinePermission(UUID player, PermissionNode<T> node, PermissionDynamicContext<?>... context) <T> TgetPermission(ServerPlayer player, PermissionNode<T> node, PermissionDynamicContext<?>... context) Set<PermissionNode<?>>Returns an unmodifiable view of the collection of registered permission nodes. 
- 
Field Details
- 
IDENTIFIER
 - 
registeredNodes
 - 
immutableRegisteredNodes
 
 - 
 - 
Constructor Details
- 
DefaultPermissionHandler
 
 - 
 - 
Method Details
- 
getIdentifier
Description copied from interface:IPermissionHandlerReturns an identifier for the PermissionHandler.- Specified by:
 getIdentifierin interfaceIPermissionHandler- Returns:
 - an identifier for the PermissionHandler
 
 - 
getRegisteredNodes
Description copied from interface:IPermissionHandlerReturns an unmodifiable view of the collection of registered permission nodes.- Specified by:
 getRegisteredNodesin interfaceIPermissionHandler- Returns:
 - an unmodifiable view of the collection of registered permission nodes
 
 - 
getPermission
public <T> T getPermission(ServerPlayer player, PermissionNode<T> node, PermissionDynamicContext<?>... context) Description copied from interface:IPermissionHandlerMods must usePermissionAPI.getPermission(ServerPlayer, PermissionNode, PermissionDynamicContext[])Queries a player's permission for a given node and contexts
Warning: PermissionNodes must be registered using the
PermissionGatherEvent.Nodesevent before querying.- Specified by:
 getPermissionin interfaceIPermissionHandler- Type Parameters:
 T- type of the queried PermissionNode- Parameters:
 player- player for which you want to check permissionsnode- the PermissionNode for which you want to querycontext- optional array of PermissionDynamicContext, single entries will be ignored if they weren't registered to the node- Returns:
 - a value of type 
<T>, that the combination of Player and PermissionNode map to. 
 - 
getOfflinePermission
public <T> T getOfflinePermission(UUID player, PermissionNode<T> node, PermissionDynamicContext<?>... context) Description copied from interface:IPermissionHandler- Specified by:
 getOfflinePermissionin interfaceIPermissionHandler- Type Parameters:
 T- type of the queried PermissionNode- Parameters:
 player- offline player for which you want to check permissionsnode- the PermissionNode for which you want to querycontext- optional array of PermissionDynamicContext, single entries will be ignored if they weren't registered to the node- Returns:
 - a value of type 
<T>, that the combination of Player and PermissionNode map to. 
 
 -