Class DatPermissions
java.lang.Object
com.datdeveloper.datmoddingapi.permissions.DatPermissions
A utility class for checking permissions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
hasAllPermissions
(net.minecraft.commands.CommandSource source, net.minecraftforge.server.permission.nodes.PermissionNode<Boolean>... permissionNodes) Checks if the given CommandSource has all the given permissionstatic boolean
hasAnyPermissions
(net.minecraft.commands.CommandSource source, net.minecraftforge.server.permission.nodes.PermissionNode<Boolean>... permissionNodes) Checks if the given CommandSource has any of the given permissionstatic boolean
hasPermission
(net.minecraft.commands.CommandSource source, net.minecraftforge.server.permission.nodes.PermissionNode<Boolean> permissionNode) Checks if the given CommandSource has the given permission
-
Constructor Details
-
DatPermissions
public DatPermissions()
-
-
Method Details
-
hasPermission
public static boolean hasPermission(net.minecraft.commands.CommandSource source, net.minecraftforge.server.permission.nodes.PermissionNode<Boolean> permissionNode) Checks if the given CommandSource has the given permission- Parameters:
source
- The CommandSource being testedpermissionNode
- The permission node to test- Returns:
- true if the CommandSource has permission
-
hasAnyPermissions
@SafeVarargs public static boolean hasAnyPermissions(net.minecraft.commands.CommandSource source, net.minecraftforge.server.permission.nodes.PermissionNode<Boolean>... permissionNodes) Checks if the given CommandSource has any of the given permission- Parameters:
source
- The CommandSource being testedpermissionNodes
- The permission nodes to test- Returns:
- true if the CommandSource has any of the given permissions
-
hasAllPermissions
@SafeVarargs public static boolean hasAllPermissions(net.minecraft.commands.CommandSource source, net.minecraftforge.server.permission.nodes.PermissionNode<Boolean>... permissionNodes) Checks if the given CommandSource has all the given permission- Parameters:
source
- The CommandSource being testedpermissionNodes
- The permission nodes to test- Returns:
- true if the CommandSource has all the given permissions
-