Enum Class CustomTag

java.lang.Object
java.lang.Enum<CustomTag>
me.deecaad.weaponmechanics.utils.CustomTag
All Implemented Interfaces:
Serializable, Comparable<CustomTag>, Constable

public enum CustomTag extends Enum<CustomTag>
This enum is used to keep a list of all NBT tags used by WeaponMechanics. This enum also wraps the NBTCompatibility api, making it easier to access data from items.
  • 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
    Ammo left is stored as an int, and is used by WeaponMechanics to store the amount of ammo left in the gun.
    Ammo magazine is stored as an int, and is used by WeaponMechanics to determine if the ammo was loaded as a magazine, or as individual bullets.
    The ammo name is stored as a String, and is used by WeaponMechanics to determine if an item can be used as ammunition.
    Ammo type index is stored as an int, and is used by WeaponMechanics to determine which ammo type that is currently loaded in the weapon.
    Armor title is stored as a string, and is used by ArmorMechanics to determine if an item is a custom armor added by the plugin.
    Attachment title is stored as a string, and is used by WeaponMechanicsPlus to determine if an item is an attachment.
    Attachments are stored as a list of strings, and is used by WeaponMechanicsPlus to determine which attachments are attached to a weapon.
    Firearm action state is stored as an int, and is used by WeaponMechanics to check if the weapon is open/closed.
    Prevent remove is stored as an int, and is used by ArmorMechanics as a marker to prevent armor from being unequipped.
    Selective fire is stored as an int, and is used by WeaponMechanics to determine the current selective fire rate of the weapon.
    Weapon skin is stored as a string, and is used by WeaponMechanicsCosmetics to determine if a weapon has a set skin.
    The weapon title is stored as a String, and is used by WeaponMechanics to determine if an item is a weapon, and which weapon it is.
  • Method Summary

    Modifier and Type
    Method
    Description
    int[]
    getArray(org.bukkit.inventory.ItemStack item)
     
    double
    getDouble(org.bukkit.inventory.ItemStack item)
     
     
    int
    getInteger(org.bukkit.inventory.ItemStack item)
     
     
    getString(org.bukkit.inventory.ItemStack item)
     
    getStringArray(org.bukkit.inventory.ItemStack item)
     
    boolean
    hasArray(org.bukkit.inventory.ItemStack item)
     
    boolean
    hasDouble(org.bukkit.inventory.ItemStack item)
     
    boolean
    hasInteger(org.bukkit.inventory.ItemStack item)
     
    boolean
    hasString(org.bukkit.inventory.ItemStack item)
     
    boolean
    hasStringArray(org.bukkit.inventory.ItemStack item)
     
    void
    remove(org.bukkit.inventory.ItemStack item)
     
    void
    setArray(org.bukkit.inventory.ItemStack item, int[] value)
     
    void
    setDouble(org.bukkit.inventory.ItemStack item, double value)
     
    void
    setInteger(org.bukkit.inventory.ItemStack item, int value)
     
    void
    setString(org.bukkit.inventory.ItemStack item, String value)
     
    void
    setStringArray(org.bukkit.inventory.ItemStack item, String[] value)
     
    static CustomTag
    Returns the enum constant of this class with the specified name.
    static CustomTag[]
    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

    • WEAPON_TITLE

      public static final CustomTag WEAPON_TITLE
      The weapon title is stored as a String, and is used by WeaponMechanics to determine if an item is a weapon, and which weapon it is. The title can be used to retrieve values from config.
    • SELECTIVE_FIRE

      public static final CustomTag SELECTIVE_FIRE
      Selective fire is stored as an int, and is used by WeaponMechanics to determine the current selective fire rate of the weapon. 0 = single, 1 = burst, and 2 = auto.
    • AMMO_LEFT

      public static final CustomTag AMMO_LEFT
      Ammo left is stored as an int, and is used by WeaponMechanics to store the amount of ammo left in the gun.
    • AMMO_TYPE_INDEX

      public static final CustomTag AMMO_TYPE_INDEX
      Ammo type index is stored as an int, and is used by WeaponMechanics to determine which ammo type that is currently loaded in the weapon. This is done since config allows for multiple ammo types to be loaded into the weapons. This is used by WeaponMechanicsPlus to add modifiers to different ammo types.
    • AMMO_TITLE

      public static final CustomTag AMMO_TITLE
      The ammo name is stored as a String, and is used by WeaponMechanics to determine if an item can be used as ammunition.
    • AMMO_MAGAZINE

      public static final CustomTag AMMO_MAGAZINE
      Ammo magazine is stored as an int, and is used by WeaponMechanics to determine if the ammo was loaded as a magazine, or as individual bullets. 0 = bullets, 1 = magazine.
    • FIREARM_ACTION_STATE

      public static final CustomTag FIREARM_ACTION_STATE
      Firearm action state is stored as an int, and is used by WeaponMechanics to check if the weapon is open/closed. 0 = Ready, 1 = Open, 2 = Closed.
      See Also:
    • ATTACHMENT_TITLE

      public static final CustomTag ATTACHMENT_TITLE
      Attachment title is stored as a string, and is used by WeaponMechanicsPlus to determine if an item is an attachment. This title can be used to get attachment information from config (or the attachment registry, stored in WeaponMechanicsPlus).
    • ATTACHMENTS

      public static final CustomTag ATTACHMENTS
      Attachments are stored as a list of strings, and is used by WeaponMechanicsPlus to determine which attachments are attached to a weapon. Each string in the list is an ATTACHMENT_TITLE, and can be used to pull information from config.
    • WEAPON_SKIN

      public static final CustomTag WEAPON_SKIN
      Weapon skin is stored as a string, and is used by WeaponMechanicsCosmetics to determine if a weapon has a set skin. This overrides the player's preferred skin.
    • ARMOR_TITLE

      public static final CustomTag ARMOR_TITLE
      Armor title is stored as a string, and is used by ArmorMechanics to determine if an item is a custom armor added by the plugin.
    • PREVENT_REMOVE

      public static final CustomTag PREVENT_REMOVE
      Prevent remove is stored as an int, and is used by ArmorMechanics as a marker to prevent armor from being unequipped.
  • Method Details

    • values

      public static CustomTag[] 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 CustomTag 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
    • getId

      public String getId()
      Returns:
      the id that should be put to item stack to be used that identifier
    • getKey

      public String getKey()
    • hasString

      public boolean hasString(org.bukkit.inventory.ItemStack item)
    • getString

      public String getString(org.bukkit.inventory.ItemStack item)
    • setString

      public void setString(org.bukkit.inventory.ItemStack item, String value)
    • hasInteger

      public boolean hasInteger(org.bukkit.inventory.ItemStack item)
    • getInteger

      public int getInteger(org.bukkit.inventory.ItemStack item)
    • setInteger

      public void setInteger(org.bukkit.inventory.ItemStack item, int value)
    • hasDouble

      public boolean hasDouble(org.bukkit.inventory.ItemStack item)
    • getDouble

      public double getDouble(org.bukkit.inventory.ItemStack item)
    • setDouble

      public void setDouble(org.bukkit.inventory.ItemStack item, double value)
    • hasArray

      public boolean hasArray(org.bukkit.inventory.ItemStack item)
    • getArray

      public int[] getArray(org.bukkit.inventory.ItemStack item)
    • setArray

      public void setArray(org.bukkit.inventory.ItemStack item, int[] value)
    • hasStringArray

      public boolean hasStringArray(org.bukkit.inventory.ItemStack item)
    • getStringArray

      public String[] getStringArray(org.bukkit.inventory.ItemStack item)
    • setStringArray

      public void setStringArray(org.bukkit.inventory.ItemStack item, String[] value)
    • remove

      public void remove(org.bukkit.inventory.ItemStack item)