Class NameModifier

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

public class NameModifier extends Object implements ItemMetaModifier, ItemMetaComparator
The name modifier
  • Constructor Details

    • NameModifier

      public NameModifier()
  • Method Details

    • setName

      @Contract("_ -> this") public NameModifier setName(String name)
      Set the name
      Parameters:
      name - the name
      Returns:
      this for builder chain
    • 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