Enum Class StructureAttribute

java.lang.Object
java.lang.Enum<StructureAttribute>
nl.pim16aap2.animatedarchitecture.core.structures.StructureAttribute
All Implemented Interfaces:
Serializable, Comparable<StructureAttribute>, Constable

public enum StructureAttribute extends Enum<StructureAttribute>
Represent the possible attributes of a structure.
  • Enum Constant Details

    • TOGGLE

      public static final StructureAttribute TOGGLE
      Toggle the structure. If it is currently opened, it will be closed. If it is currently closed, it will be opened instead.
    • PREVIEW

      public static final StructureAttribute PREVIEW
      Show a preview of the animation.
    • INFO

      public static final StructureAttribute INFO
      Get the info of the structure.
    • LOCK

      public static final StructureAttribute LOCK
      (Un)lock the structure.
    • DELETE

      public static final StructureAttribute DELETE
      Delete the structure.
    • ADD_OWNER

      public static final StructureAttribute ADD_OWNER
      Add an owner.
    • REMOVE_OWNER

      public static final StructureAttribute REMOVE_OWNER
      Remove an owner.
    • BLOCKS_TO_MOVE

      public static final StructureAttribute BLOCKS_TO_MOVE
      The number of blocks an animated will try to move.
    • OPEN_DIRECTION

      public static final StructureAttribute OPEN_DIRECTION
      The open direction of a structure.
    • OPEN_STATUS

      public static final StructureAttribute OPEN_STATUS
      The open status of a structure.
    • RELOCATE_POWERBLOCK

      public static final StructureAttribute RELOCATE_POWERBLOCK
      Relocate the power block.
    • SET_PROPERTY

      public static final StructureAttribute SET_PROPERTY
      Sets a Property for a structure.
    • SWITCH

      public static final StructureAttribute SWITCH
      Turns a structure on or off. When on, the structure will rotate until turned off or until the chunks are unloaded.
  • Method Details

    • values

      public static StructureAttribute[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static StructureAttribute valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • canAccessWith

      public boolean canAccessWith(PermissionLevel permissionLevel)
      Checks if a given permission level has access to this attribute.
      Parameters:
      permissionLevel - The permission level to check.
      Returns:
      True if the given permission level has access to this attribute.
    • getValues

      public static List<StructureAttribute> getValues()
      Returns all values in this enum as an unmodifiable list.

      Unlike values(), this does not create a new object.

      Returns:
      All values in this enum as an unmodifiable list.
    • getAdminPermissionNode

      public static String getAdminPermissionNode(StructureAttribute structureAttribute)
      Gets the admin permission node for a given StructureAttribute.

      Consider using getAdminPermissionNode() instead, as it uses the cached value.

      Parameters:
      structureAttribute - The StructureAttribute to get the admin permission node for.
      Returns:
      The admin permission node for the given StructureAttribute.
    • getPermissionLevel

      public PermissionLevel getPermissionLevel()
      The minimum level of ownership required to access an attribute.
    • getAdminPermissionNode

      public String getAdminPermissionNode()
      The admin permission node for this attribute.