Class ItemChecker

java.lang.Object
studio.magemonkey.fabled.dynamic.ItemChecker

public class ItemChecker extends Object
Handles checking items for dynamic effects
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    check(org.bukkit.entity.Player player, int level, EffectComponent component, boolean remove)
    Checks the player inventory for items matching the settings
    static boolean
    check(org.bukkit.inventory.ItemStack item, int level, Settings settings)
    Checks an individual item to see if it matches the settings
    static boolean
    checkLore(org.bukkit.inventory.ItemStack item, String target, boolean regex)
    Checks the lore of an item
    static boolean
    checkName(org.bukkit.inventory.ItemStack item, String target, boolean regex)
    Checks the display name of the item
    static boolean
    findLore(org.bukkit.entity.LivingEntity caster, org.bukkit.inventory.ItemStack item, String regex, String key, double multiplier, boolean save)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 check
      level - level of the effect
      component - effect component checking for
      remove - whether to remove matching items
      Returns:
      true if all conditions met, false otherwise
    • check

      public static boolean check(org.bukkit.inventory.ItemStack item, int level, Settings settings)
      Checks an individual item to see if it matches the settings
      Parameters:
      item - item to check
      level - level of the effect
      settings - settings to apply
      Returns:
      true if passes all conditions, false otherwise
    • checkName

      public static boolean checkName(org.bukkit.inventory.ItemStack item, String target, boolean regex)
      Checks the display name of the item
      Parameters:
      item - item to check
      target - display name desired
      regex - whether the target is a regex pattern
      Returns:
      true if matches, false otherwise
    • checkLore

      public static boolean checkLore(org.bukkit.inventory.ItemStack item, String target, boolean regex)
      Checks the lore of an item
      Parameters:
      item - item to check
      target - lore text desired
      regex - whether the target is a regex pattern
      Returns:
      true if matches, false otherwise
    • findLore

      public static boolean findLore(org.bukkit.entity.LivingEntity caster, org.bukkit.inventory.ItemStack item, String regex, String key, double multiplier, boolean save)