Package me.deecaad.weaponmechanics.utils
Enum Class CustomTag
- All Implemented Interfaces:
Serializable,Comparable<CustomTag>,Constable
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 ConstantsEnum ConstantDescriptionAmmo 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 TypeMethodDescriptionint[]getArray(org.bukkit.inventory.ItemStack item) doublegetDouble(org.bukkit.inventory.ItemStack item) getId()intgetInteger(org.bukkit.inventory.ItemStack item) getKey()getString(org.bukkit.inventory.ItemStack item) String[]getStringArray(org.bukkit.inventory.ItemStack item) booleanhasArray(org.bukkit.inventory.ItemStack item) booleanhasDouble(org.bukkit.inventory.ItemStack item) booleanhasInteger(org.bukkit.inventory.ItemStack item) booleanhasString(org.bukkit.inventory.ItemStack item) booleanhasStringArray(org.bukkit.inventory.ItemStack item) voidremove(org.bukkit.inventory.ItemStack item) voidsetArray(org.bukkit.inventory.ItemStack item, int[] value) voidsetDouble(org.bukkit.inventory.ItemStack item, double value) voidsetInteger(org.bukkit.inventory.ItemStack item, int value) voidvoidsetStringArray(org.bukkit.inventory.ItemStack item, String[] value) static CustomTagReturns the enum constant of this class with the specified name.static CustomTag[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
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
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
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
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
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
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
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
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 anATTACHMENT_TITLE, and can be used to pull information from config. -
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
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
Prevent remove is stored as an int, and is used by ArmorMechanics as a marker to prevent armor from being unequipped.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getId
- Returns:
- the id that should be put to item stack to be used that identifier
-
getKey
-
hasString
public boolean hasString(org.bukkit.inventory.ItemStack item) -
getString
-
setString
-
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
-
setStringArray
-
remove
public void remove(org.bukkit.inventory.ItemStack item)
-