Class SimplePermissions

java.lang.Object
net.dillon.dillonlib.util.SimplePermissions

public class SimplePermissions extends Object
A utility class for getting simple permission levels that can be used in custom commands.
Since:
1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    admin(net.minecraft.commands.CommandSourceStack commandSourceStack)
     
    static boolean
    all(net.minecraft.commands.CommandSourceStack commandSourceStack)
     
    static boolean
    gamemaster(net.minecraft.commands.CommandSourceStack commandSourceStack)
     
    static boolean
    hasPermissionLevel(net.minecraft.commands.CommandSourceStack commandSourceStack, net.minecraft.server.permissions.PermissionLevel level)
     
    static boolean
    moderator(net.minecraft.commands.CommandSourceStack commandSourceStack)
     
    static boolean
    notPlayer(net.minecraft.commands.CommandSourceStack commandSourceStack)
     
    static boolean
    owner(net.minecraft.commands.CommandSourceStack commandSourceStack)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SimplePermissions

      public SimplePermissions()
  • Method Details

    • hasPermissionLevel

      public static boolean hasPermissionLevel(net.minecraft.commands.CommandSourceStack commandSourceStack, net.minecraft.server.permissions.PermissionLevel level)
      Returns:
      if the player's permission level is equivalent to the passed in value.
    • all

      public static boolean all(net.minecraft.commands.CommandSourceStack commandSourceStack)
      Returns:
      if the player has no permissions (meaning they can use any non-op required command).
    • moderator

      public static boolean moderator(net.minecraft.commands.CommandSourceStack commandSourceStack)
      Returns:
      if the player has moderator permissions.
    • gamemaster

      public static boolean gamemaster(net.minecraft.commands.CommandSourceStack commandSourceStack)
      Returns:
      if the player has gamemaster permissions.
    • admin

      public static boolean admin(net.minecraft.commands.CommandSourceStack commandSourceStack)
      Returns:
      if the player has admin (or operator) permissions.
    • owner

      public static boolean owner(net.minecraft.commands.CommandSourceStack commandSourceStack)
      Returns:
      if the player has owner permissions.
    • notPlayer

      public static boolean notPlayer(net.minecraft.commands.CommandSourceStack commandSourceStack)
      Returns:
      the command has to be executed by console or command block (not directly by a player).