Interface ItemManager


public interface ItemManager
An interface used to add modifiers to items and parse items from configuration.
  • Method Details

    • addStatModifier

      org.bukkit.inventory.ItemStack addStatModifier(org.bukkit.inventory.ItemStack item, ModifierType type, Stat stat, double value, AuraSkillsModifier.Operation operation, boolean lore)
      Adds a stat modifier to an item, with optional lore. This does not change the item passed in directly, you must use the returned ItemStack. This means the original ItemStack passed in is not changed at all, a new one is created.
      Parameters:
      item - the original item, will not be changed by the method
      type - the ModifierType to add
      stat - the stat to add (Use Stats enum for default stats)
      value - the value of the stat to add
      lore - whether to add lore
      Returns:
      a new ItemStack with the static modifier
    • addStatModifier

      @Deprecated org.bukkit.inventory.ItemStack addStatModifier(org.bukkit.inventory.ItemStack item, ModifierType type, Stat stat, double value, boolean lore)
    • addTraitModifier

      org.bukkit.inventory.ItemStack addTraitModifier(org.bukkit.inventory.ItemStack item, ModifierType type, Trait trait, double value, AuraSkillsModifier.Operation operation, boolean lore)
      Adds a trait modifier to an item, with optional lore. This does not change the item passed in directly, you must use the returned ItemStack.
      Parameters:
      item - the original item
      type - the ModifierType to add
      trait - the trait to add (Use Traits enum for default stats)
      value - the value of the trait to add
      lore - whether to add lore
      Returns:
      a new ItemStack with the trait modifier
    • addTraitModifier

      @Deprecated org.bukkit.inventory.ItemStack addTraitModifier(org.bukkit.inventory.ItemStack item, ModifierType type, Trait trait, double value, boolean lore)
    • addModifier

      @Deprecated org.bukkit.inventory.ItemStack addModifier(org.bukkit.inventory.ItemStack item, ModifierType type, Stat stat, double value, boolean lore)
    • getStatModifiers

      List<StatModifier> getStatModifiers(org.bukkit.inventory.ItemStack item, ModifierType type)
      Gets a list of stat modifiers on an item for a given modifier type.
      Parameters:
      item - the item to get the modifiers of
      type - the modifier type
      Returns:
      a list of modifiers
    • getTraitModifiers

      List<TraitModifier> getTraitModifiers(org.bukkit.inventory.ItemStack item, ModifierType type)
      Gets a list of trait modifiers on an item for a given modifier type.
      Parameters:
      item - the item to get the trait modifiers of
      type - the modifier type
      Returns:
      a list of modifiers
    • getModifiers

      @Deprecated List<StatModifier> getModifiers(org.bukkit.inventory.ItemStack item, ModifierType type)
    • removeStatModifier

      org.bukkit.inventory.ItemStack removeStatModifier(org.bukkit.inventory.ItemStack item, ModifierType type, Stat stat)
      Removes a stat modifier from an item for a given modifier type and stat. Does not modify the ItemStack passed in, instead returns a copy of the item with the modifier removed. Will not remove any lore.
      Parameters:
      item - The item to remove the modifier from. Does not get modified.
      type - the modifier type
      stat - the stat of the modifier to remove
      Returns:
      the item with the modifier removed
    • removeTraitModifier

      org.bukkit.inventory.ItemStack removeTraitModifier(org.bukkit.inventory.ItemStack item, ModifierType type, Trait trait)
      Removes a trait modifier from an item for a given modifier type and stat. Does not modify the ItemStack passed in, instead returns a copy of the item with the modifier removed. Will not remove any lore.
      Parameters:
      item - The item to remove the modifier from. Does not get modified.
      type - the modifier type
      trait - the trait of the modifier to remove
      Returns:
      the item with the modifier removed
    • removeModifier

      @Deprecated org.bukkit.inventory.ItemStack removeModifier(org.bukkit.inventory.ItemStack item, ModifierType type, Stat stat)
    • addMultiplier

      org.bukkit.inventory.ItemStack addMultiplier(org.bukkit.inventory.ItemStack item, ModifierType type, Skill skill, double value, boolean lore)
      Adds a multiplier to an item, with optional lore. This does not change the item passed in directly, you must use the returned ItemStack. This means the original ItemStack passed in is not changed at all, a new one is created.
      Parameters:
      item - the original item, will not be changed by the method
      type - the ModifierType to add
      skill - the skill to add (Use Skills enum for default skills)
      value - the value of the multiplier (in percentage points) to add
      lore - whether to add lore
      Returns:
      a new ItemStack with the multiplier
    • getMultipliers

      List<Multiplier> getMultipliers(org.bukkit.inventory.ItemStack item, ModifierType type)
      Gets a list of skill multipliers on an item for a given modifier type.
      Parameters:
      item - the item to get the multipliers of
      type - the modifier type
      Returns:
      a list of multipliers
    • removeMultiplier

      org.bukkit.inventory.ItemStack removeMultiplier(org.bukkit.inventory.ItemStack item, ModifierType type, Skill skill)
      Removes a multiplier from an item for the given skill. Does not modify the item, instead returns a copy with the multiplier removed. Will not remove any lore.
      Parameters:
      item - item to remove the multiplier from
      type - the type of modifier
      skill - the skill of the multiplier to remove, or null for global multipliers
      Returns:
      the modified item with the multiplier removed
    • addRequirement

      org.bukkit.inventory.ItemStack addRequirement(org.bukkit.inventory.ItemStack item, ModifierType type, Skill skill, int level, boolean lore)
      Adds a skill requirement to use an item, with optional lore. This does not change the item passed in directly, you must use the returned ItemStack. This means the original ItemStack passed in is not changed at all, a new one is created.
      Parameters:
      item - the original item, will not be changed by the method
      type - the ModifierType to add
      skill - the skill the requirement is for (Use Skills enum for default skills)
      level - the skill level required to use the item
      lore - whether to add lore
      Returns:
      a new ItemStack with the requirement
    • getRequirements

      Map<Skill,Integer> getRequirements(org.bukkit.inventory.ItemStack item, ModifierType type)
      Gets the skill requirements for an item.
      Parameters:
      item - the item to get the requirements of
      type - the modifier type
      Returns:
      a map of skill requirements, where the key is the skill and the level requirements is the value
    • removeRequirement

      org.bukkit.inventory.ItemStack removeRequirement(org.bukkit.inventory.ItemStack item, ModifierType type, Skill skill)
      Removes a skill requirement from an item. Does not modify the item, instead returns a copy of the item with the requirement removed. Does not modify lore.
      Parameters:
      item - the item to remove the requirement from
      type - the modifier type
      skill - the skill of the requirement to remove
      Returns:
      the modified item with the requirement removed
    • passesFilter

      boolean passesFilter(org.bukkit.inventory.ItemStack item, ItemFilter filter)
      Test whether a given ItemStack passes a source ItemFilter. Used to implement the leveler of a CustomSource with an ItemFilter field.
      Parameters:
      item - the item to test
      filter - the filter to test with
      Returns:
      whether the item passes the filter
    • parseItem

      org.bukkit.inventory.ItemStack parseItem(ConfigNode config)
      Parses an ItemStack from a ConfigurationNode section in the same format used to parse items in default loot and menus.
      Parameters:
      config - the Configurate ConfigurationNode to parse keys from, should be a mapping
      Returns:
      the parsed ItemStack
    • parseItem

      @Deprecated org.bukkit.inventory.ItemStack parseItem(org.spongepowered.configurate.ConfigurationNode config)
      Deprecated.
    • parseMultipleItems

      List<org.bukkit.inventory.ItemStack> parseMultipleItems(ConfigNode config)
      Parses a list of ItemStack from a ConfigurationNode if it has a materials list. Only the material differs between each item, the amount and all meta remains the same across items. If a regular material string is defined, a single item will be parsed like parseItem(ConfigNode) and the list returned will be of size 1.
      Parameters:
      config - the Configurate ConfigurationNode to parse keys from, should be a mapping
      Returns:
      a list of parsed ItemStack
    • parseMultipleItems

      @Deprecated List<org.bukkit.inventory.ItemStack> parseMultipleItems(org.spongepowered.configurate.ConfigurationNode config)
      Deprecated.