Class EnchantmentModifier

java.lang.Object
me.hsgamer.hscore.bukkit.item.modifier.EnchantmentModifier
All Implemented Interfaces:
ItemMetaComparator, ItemMetaModifier, ItemComparator<org.bukkit.inventory.ItemStack>, ItemModifier<org.bukkit.inventory.ItemStack>

public class EnchantmentModifier extends Object implements ItemMetaModifier, ItemMetaComparator
The enchantment modifier
  • Constructor Details

    • EnchantmentModifier

      public EnchantmentModifier()
  • Method Details

    • modifyMeta

      @NotNull public @NotNull org.bukkit.inventory.meta.ItemMeta modifyMeta(@NotNull @NotNull org.bukkit.inventory.meta.ItemMeta meta, @Nullable @Nullable UUID uuid, @NotNull @NotNull StringReplacer stringReplacer)
      Description copied from interface: ItemMetaModifier
      Modify the item meta
      Specified by:
      modifyMeta in interface ItemMetaModifier
      Parameters:
      meta - the item meta
      uuid - the unique id
      stringReplacer - the string replacer
      Returns:
      the modified item meta
    • loadFromItemMeta

      public boolean loadFromItemMeta(org.bukkit.inventory.meta.ItemMeta meta)
      Description copied from interface: ItemMetaModifier
      Load the modifier from the item meta
      Specified by:
      loadFromItemMeta in interface ItemMetaModifier
      Parameters:
      meta - the item meta
      See Also:
    • compare

      public boolean compare(@NotNull @NotNull org.bukkit.inventory.meta.ItemMeta meta, @Nullable @Nullable UUID uuid, @NotNull @NotNull StringReplacer stringReplacer)
      Description copied from interface: ItemMetaComparator
      Compare the modifier of an item meta
      Specified by:
      compare in interface ItemMetaComparator
      Parameters:
      meta - the item meta
      uuid - the unique id
      stringReplacer - the string replacer
      Returns:
      true if it matches, otherwise false
      See Also:
    • toObject

      public Object toObject()
      Description copied from interface: ItemModifier
      Serialize the modifier to an object
      Specified by:
      toObject in interface ItemModifier<org.bukkit.inventory.ItemStack>
      Returns:
      the object
    • loadFromObject

      public void loadFromObject(Object object)
      Description copied from interface: ItemModifier
      Load the modifier from an object
      Specified by:
      loadFromObject in interface ItemModifier<org.bukkit.inventory.ItemStack>
      Parameters:
      object - the object
    • addEnchantment

      @Contract("_, _ -> this") public EnchantmentModifier addEnchantment(String enchantment, int level)
      Add an enchantment
      Parameters:
      enchantment - the enchantment
      level - the level
      Returns:
      this for builder chain
    • addEnchantment

      @Contract("_, _ -> this") public EnchantmentModifier addEnchantment(org.bukkit.enchantments.Enchantment enchantment, int level)
      Add an enchantment
      Parameters:
      enchantment - the enchantment
      level - the level
      Returns:
      this for builder chain
    • addEnchantment

      @Contract("_ -> this") public EnchantmentModifier addEnchantment(String enchantment)
      Add an enchantment
      Parameters:
      enchantment - the enchantment
      Returns:
      this for builder chain
    • addEnchantment

      @Contract("_ -> this") public EnchantmentModifier addEnchantment(org.bukkit.enchantments.Enchantment enchantment)
      Add an enchantment
      Parameters:
      enchantment - the enchantment
      Returns:
      this for builder chain