Class ItemLoreStat<Z>

java.lang.Object
studio.magemonkey.divinity.stats.items.api.ItemLoreStat<Z>
Direct Known Subclasses:
AmmoAttribute, ChargesAttribute, DuplicableItemLoreStat, DurabilityStat, FabledAttribute, HandAttribute, ItemRequirement, UserRequirement

public abstract class ItemLoreStat<Z> extends Object
  • Field Details

    • name

      protected String name
    • format

      protected final String format
    • placeholder

      protected final String placeholder
    • keys

      protected final List<org.bukkit.NamespacedKey> keys
    • dataType

      protected org.bukkit.persistence.PersistentDataType<?,Z> dataType
    • metaId

      protected final String metaId
  • Constructor Details

    • ItemLoreStat

      public ItemLoreStat(@NotNull String id, @NotNull String name, @NotNull String format, @NotNull String placeholder, @NotNull String uniqueTag, @NotNull org.bukkit.persistence.PersistentDataType<?,Z> dataType)
  • Method Details

    • getParameterClass

      @NotNull public abstract Class<Z> getParameterClass()
    • getId

      @NotNull public final String getId()
    • getName

      @NotNull public final String getName()
    • getMetaId

      public final String getMetaId(@NotNull org.bukkit.inventory.ItemStack item)
    • getMetaId

      public final String getMetaId(@NotNull org.bukkit.inventory.ItemStack item, int index)
    • isSingle

      protected boolean isSingle()
      Defines if only ONE variant of this Item Stat can be applied to the item at the same time. Ammo Stat will return 'TRUE' as bow may have only one ammo type, Damage Stat will return 'FALSE' as item may have multiple damage types.
    • getKeys

      @NotNull public final List<org.bukkit.NamespacedKey> getKeys()
    • getKey

      @NotNull public final org.bukkit.NamespacedKey getKey()
    • getPlaceholder

      @NotNull public final String getPlaceholder()
    • getFormat

      @NotNull public String getFormat()
    • getFormat

      @NotNull public String getFormat(@NotNull org.bukkit.inventory.ItemStack item, @NotNull Z value)
    • add

      public boolean add(@NotNull org.bukkit.inventory.ItemStack item, @NotNull Z value, int line)
    • remove

      public final void remove(@NotNull org.bukkit.inventory.ItemStack item)
    • getRaw

      @Nullable public final Z getRaw(@NotNull org.bukkit.inventory.ItemStack item)
    • getLoreIndex

      public final int getLoreIndex(@NotNull org.bukkit.inventory.ItemStack item)
    • isApplied

      public final boolean isApplied(@NotNull org.bukkit.inventory.ItemStack item)
      Parameters:
      item - Item to check.
      Returns:
      true if stat is present in item lore (position >= 0). Does not check for item meta.
    • hasPlaceholder

      public final boolean hasPlaceholder(@NotNull org.bukkit.inventory.ItemStack item)
    • preparePlaceholder

      protected final void preparePlaceholder(@NotNull org.bukkit.inventory.ItemStack item, int line)
    • formatValue

      @NotNull public abstract String formatValue(@NotNull org.bukkit.inventory.ItemStack item, @NotNull Z value)