Class MaterialModifier

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

public class MaterialModifier extends Object implements ItemComparator<org.bukkit.inventory.ItemStack>, ItemModifier<org.bukkit.inventory.ItemStack>
The material modifier
  • Constructor Details

    • MaterialModifier

      public MaterialModifier()
  • Method Details

    • modify

      @NotNull public @NotNull org.bukkit.inventory.ItemStack modify(@NotNull @NotNull org.bukkit.inventory.ItemStack original, UUID uuid, @NotNull @NotNull StringReplacer stringReplacer)
      Description copied from interface: ItemModifier
      Modify the item
      Specified by:
      modify in interface ItemModifier<org.bukkit.inventory.ItemStack>
      Parameters:
      original - the original item
      uuid - the unique id
      stringReplacer - the string replacer
      Returns:
      the modified item
    • 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
    • loadFromItem

      public boolean loadFromItem(org.bukkit.inventory.ItemStack item)
      Description copied from interface: ItemModifier
      Load the modifier from an item
      Specified by:
      loadFromItem in interface ItemModifier<org.bukkit.inventory.ItemStack>
      Parameters:
      item - the item
      Returns:
      true if it can
    • compare

      public boolean compare(@NotNull @NotNull org.bukkit.inventory.ItemStack item, UUID uuid, @NotNull @NotNull StringReplacer stringReplacer)
      Description copied from interface: ItemComparator
      Compare the modifier of an item
      Specified by:
      compare in interface ItemComparator<org.bukkit.inventory.ItemStack>
      Parameters:
      item - the item
      uuid - the unique id
      stringReplacer - the string replacer
      Returns:
      true if it matches, otherwise false
    • setMaterial

      @Contract("_ -> this") public MaterialModifier setMaterial(org.bukkit.Material material)
      Set the material
      Parameters:
      material - the material
      Returns:
      this for builder chain
    • setMaterial

      @Contract("_ -> this") public MaterialModifier setMaterial(String... material)
      Set the material
      Parameters:
      material - the material
      Returns:
      this for builder chain