Enum Class ScenarioFieldType

java.lang.Object
java.lang.Enum<ScenarioFieldType>
dev.itsharshxd.zentrix.api.scenario.ScenarioFieldType
All Implemented Interfaces:
Serializable, Comparable<ScenarioFieldType>, Constable

public enum ScenarioFieldType extends Enum<ScenarioFieldType>
The value kinds one field of a structured entry can hold.

A field type decides how a single value inside a ScenarioSettingType.STRUCTURED_LIST entry is validated, how the management GUI edits it, and how it is written back to scenarios.yml. It is deliberately the same idea as ScenarioSettingType, minus the list kinds: an entry field always holds one value, because the entry itself is what the list is made of.

Since:
1.6.0
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    A placed block, written as an identifier Zentrix can match against a block in the world.
    A toggle, edited by clicking.
    A fractional number bounded by the field's minimum and maximum.
    One of the field's allowed values, cycled by clicking.
    A whole number bounded by the field's minimum and maximum.
    An item, written as an identifier Zentrix can resolve into an ItemStack.
    A single Bukkit Material name.
    Free text, captured from chat.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether this field accepts the numeric bounds of its declaration.
    boolean
    Whether values of this field are typed in chat rather than clicked.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • STRING

      public static final ScenarioFieldType STRING
      Free text, captured from chat.
    • INTEGER

      public static final ScenarioFieldType INTEGER
      A whole number bounded by the field's minimum and maximum.
    • DECIMAL

      public static final ScenarioFieldType DECIMAL
      A fractional number bounded by the field's minimum and maximum.
    • BOOLEAN

      public static final ScenarioFieldType BOOLEAN
      A toggle, edited by clicking.
    • ENUM

      public static final ScenarioFieldType ENUM
      One of the field's allowed values, cycled by clicking.
    • MATERIAL

      public static final ScenarioFieldType MATERIAL
      A single Bukkit Material name.
    • ITEM

      public static final ScenarioFieldType ITEM
      An item, written as an identifier Zentrix can resolve into an ItemStack.

      Accepted forms are a vanilla material name, custom:<items.yml key>, itemsadder:<namespace:id> and nexo:<id>. An identifier belonging to a plugin that is not installed is rejected when it is entered, so a stored value always resolves.

    • BLOCK

      public static final ScenarioFieldType BLOCK
      A placed block, written as an identifier Zentrix can match against a block in the world.

      Accepted forms are a vanilla block material name, itemsadder:<namespace:id> and nexo:<id>. Item-only material names are rejected, because nothing in a world could ever match them.

  • Method Details

    • values

      public static ScenarioFieldType[] 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 ScenarioFieldType 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
    • isNumeric

      public boolean isNumeric()
      Whether this field accepts the numeric bounds of its declaration.
    • isTyped

      public boolean isTyped()
      Whether values of this field are typed in chat rather than clicked.