Package studio.magemonkey.fabled.dynamic
Class ItemChecker
java.lang.Object
studio.magemonkey.fabled.dynamic.ItemChecker
Handles checking items for dynamic effects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
check
(org.bukkit.entity.Player player, int level, EffectComponent component, boolean remove) Checks the player inventory for items matching the settingsstatic boolean
Checks an individual item to see if it matches the settingsstatic boolean
Checks the lore of an itemstatic boolean
Checks the display name of the itemstatic boolean
findLore
(org.bukkit.entity.LivingEntity caster, org.bukkit.inventory.ItemStack item, String regex, String key, double multiplier, boolean save)
-
Constructor Details
-
ItemChecker
public ItemChecker()
-
-
Method Details
-
check
public static boolean check(org.bukkit.entity.Player player, int level, EffectComponent component, boolean remove) Checks the player inventory for items matching the settings- Parameters:
player
- player to checklevel
- level of the effectcomponent
- effect component checking forremove
- whether to remove matching items- Returns:
- true if all conditions met, false otherwise
-
check
Checks an individual item to see if it matches the settings- Parameters:
item
- item to checklevel
- level of the effectsettings
- settings to apply- Returns:
- true if passes all conditions, false otherwise
-
checkName
Checks the display name of the item- Parameters:
item
- item to checktarget
- display name desiredregex
- whether the target is a regex pattern- Returns:
- true if matches, false otherwise
-
checkLore
Checks the lore of an item- Parameters:
item
- item to checktarget
- lore text desiredregex
- whether the target is a regex pattern- Returns:
- true if matches, false otherwise
-
findLore
-