Class PermissionAPI
java.lang.Object
net.minecraftforge.server.permission.PermissionAPI
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static IPermissionHandlerprivate static final org.apache.logging.log4j.Logger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic @Nullable ResourceLocationstatic <T> TgetOfflinePermission(UUID player, PermissionNode<T> node, PermissionDynamicContext<?>... context) static <T> TgetPermission(ServerPlayer player, PermissionNode<T> node, PermissionDynamicContext<?>... context) Queries a player's permission for a given node and contextsstatic Collection<PermissionNode<?>>static voidHelper method for internal use only!
- 
Field Details- 
LOGGERprivate static final org.apache.logging.log4j.Logger LOGGER
- 
activeHandler
 
- 
- 
Constructor Details- 
PermissionAPIprivate PermissionAPI()
 
- 
- 
Method Details- 
getRegisteredNodes
- 
getActivePermissionHandler- Returns:
- the Identifier of the currently active permission handler
 
- 
getPermissionpublic static <T> T getPermission(ServerPlayer player, PermissionNode<T> node, PermissionDynamicContext<?>... context) Queries a player's permission for a given node and contexts Warning: PermissionNodes must be registered using the PermissionGatherEvent.Nodesevent before querying.- Type Parameters:
- T- type of the queried PermissionNode
- Parameters:
- player- player for which you want to check permissions
- node- the PermissionNode for which you want to query
- context- 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, defaults to the PermissionNodes default handler.
- Throws:
- UnregisteredPermissionException- when the PermissionNode wasn't registered properly
 
- 
getOfflinePermissionpublic static <T> T getOfflinePermission(UUID player, PermissionNode<T> node, PermissionDynamicContext<?>... context) - Type Parameters:
- T- type of the queried PermissionNode
- Parameters:
- player- offline player for which you want to check permissions
- node- the PermissionNode for which you want to query
- context- 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, defaults to the PermissionNodes default handler.
- Throws:
- UnregisteredPermissionException- when the PermissionNode wasn't registered properly
 
- 
initializePermissionAPIpublic static void initializePermissionAPI()Helper method for internal use only! Initializes the active permission handler based on the users config. 
 
-