Package dev.aurelium.auraskills.api.item
Interface ItemManager
public interface ItemManager
-
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStack
addModifier
(org.bukkit.inventory.ItemStack item, ModifierType type, Stat stat, double value, boolean lore) Adds a modifier to an item, with optional lore.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.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.getModifiers
(org.bukkit.inventory.ItemStack item, ModifierType type) Gets a list of stat modifiers on an item for a given modifier type.getMultipliers
(org.bukkit.inventory.ItemStack item, ModifierType type) Gets a list of skill multipliers on an item for a given modifier type.getRequirements
(org.bukkit.inventory.ItemStack item, ModifierType type) Gets the skill requirements for an item.org.bukkit.inventory.ItemStack
parseItem
(org.spongepowered.configurate.ConfigurationNode config) Parses an ItemStack from a ConfigurationNode section in the same format used to parse items in default loot and menus.List<org.bukkit.inventory.ItemStack>
parseMultipleItems
(org.spongepowered.configurate.ConfigurationNode config) Parses a list of ItemStack from a ConfigurationNode if it has a materials list.boolean
passesFilter
(org.bukkit.inventory.ItemStack item, ItemFilter filter) Test whether a given ItemStack passes a sourceItemFilter
.org.bukkit.inventory.ItemStack
removeModifier
(org.bukkit.inventory.ItemStack item, ModifierType type, Stat stat) Removes a modifier from an item for a given modifier type and stat.org.bukkit.inventory.ItemStack
removeMultiplier
(org.bukkit.inventory.ItemStack item, ModifierType type, Skill skill) Removes a multiplier from an item for the given skill.org.bukkit.inventory.ItemStack
removeRequirement
(org.bukkit.inventory.ItemStack item, ModifierType type, Skill skill) Removes a skill requirement from an item.
-
Method Details
-
addModifier
org.bukkit.inventory.ItemStack addModifier(org.bukkit.inventory.ItemStack item, ModifierType type, Stat stat, double value, boolean lore) Adds a 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 methodtype
- theModifierType
to addstat
- the stat to add (UseStats
enum for default stats)value
- the value of the stat to addlore
- whether to add lore- Returns:
- a new ItemStack with the modifier
-
getModifiers
Gets a list of stat modifiers on an item for a given modifier type.- Parameters:
item
- the item to get the modifiers oftype
- the modifier type- Returns:
- a list of modifiers
-
removeModifier
org.bukkit.inventory.ItemStack removeModifier(org.bukkit.inventory.ItemStack item, ModifierType type, Stat stat) Removes a 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 typestat
- the stat of the modifier to remove- Returns:
- the item with the modifier removed
-
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 methodtype
- theModifierType
to addskill
- the skill to add (UseSkills
enum for default skills)value
- the value of the multiplier (in percentage points) to addlore
- whether to add lore- Returns:
- a new ItemStack with the multiplier
-
getMultipliers
Gets a list of skill multipliers on an item for a given modifier type.- Parameters:
item
- the item to get the multipliers oftype
- 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 fromtype
- the type of modifierskill
- 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 methodtype
- theModifierType
to addskill
- the skill the requirement is for (UseSkills
enum for default skills)level
- the skill level required to use the itemlore
- whether to add lore- Returns:
- a new ItemStack with the requirement
-
getRequirements
Gets the skill requirements for an item.- Parameters:
item
- the item to get the requirements oftype
- 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 fromtype
- the modifier typeskill
- the skill of the requirement to remove- Returns:
- the modified item with the requirement removed
-
passesFilter
Test whether a given ItemStack passes a sourceItemFilter
. Used to implement the leveler of aCustomSource
with anItemFilter
field.- Parameters:
item
- the item to testfilter
- the filter to test with- Returns:
- whether the item passes the filter
-
parseItem
org.bukkit.inventory.ItemStack parseItem(org.spongepowered.configurate.ConfigurationNode 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
-
parseMultipleItems
List<org.bukkit.inventory.ItemStack> parseMultipleItems(org.spongepowered.configurate.ConfigurationNode 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 likeparseItem(ConfigurationNode)
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
-