Class DatPermissions

java.lang.Object
com.datdeveloper.datmoddingapi.permissions.DatPermissions

public class DatPermissions extends Object
A utility class for checking permissions
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    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
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 tested
      permissionNode - 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 tested
      permissionNodes - 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 tested
      permissionNodes - The permission nodes to test
      Returns:
      true if the CommandSource has all the given permissions