Class LoreModifier

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

public class LoreModifier extends Object implements ItemMetaModifier, ItemMetaComparator
The lore modifier
  • Constructor Details

    • LoreModifier

      public LoreModifier()
  • 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
    • setLore

      @Contract("_ -> this") public LoreModifier setLore(String... lore)
      Set the lore
      Parameters:
      lore - the lore
      Returns:
      this for builder chain
    • addLore

      @Contract("_ -> this") public LoreModifier addLore(String lore)
      Add a lore
      Parameters:
      lore - the lore
      Returns:
      this for builder chain
    • setLore

      @Contract("_ -> this") public LoreModifier setLore(Collection<String> lore)
      Set the lore
      Parameters:
      lore - the lore
      Returns:
      this for builder chain
    • clearLore

      @Contract(" -> this") public LoreModifier clearLore()
      Clear the lore
      Returns:
      this for builder chain