Interface ItemModifier<T>

Type Parameters:
T - the type of the item
All Known Subinterfaces:
ItemMetaModifier
All Known Implementing Classes:
AmountModifier, DurabilityModifier, EnchantmentModifier, ItemFlagModifier, LoreModifier, MaterialModifier, NameModifier, NBTModifier, PotionEffectModifier, SkullModifier

public interface ItemModifier<T>
The item modifier
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Load the modifier from an item
    void
    Load the modifier from an object
    default T
    modify(T original)
    Modify the item
    default T
    modify(T original, @Nullable UUID uuid)
    Modify the item
    modify(T original, @Nullable UUID uuid, @NotNull StringReplacer stringReplacer)
    Modify the item
    Serialize the modifier to an object
  • Method Details

    • modify

      @NotNull T modify(@NotNull T original, @Nullable @Nullable UUID uuid, @NotNull @NotNull StringReplacer stringReplacer)
      Modify the item
      Parameters:
      original - the original item
      uuid - the unique id
      stringReplacer - the string replacer
      Returns:
      the modified item
    • toObject

      Object toObject()
      Serialize the modifier to an object
      Returns:
      the object
    • loadFromObject

      void loadFromObject(Object object)
      Load the modifier from an object
      Parameters:
      object - the object
    • loadFromItem

      default boolean loadFromItem(T item)
      Load the modifier from an item
      Parameters:
      item - the item
      Returns:
      true if it can
    • modify

      @NotNull default T modify(@NotNull T original, @Nullable @Nullable UUID uuid)
      Modify the item
      Parameters:
      original - the original item
      uuid - the unique id
      Returns:
      the modified item
    • modify

      @NotNull default T modify(@NotNull T original)
      Modify the item
      Parameters:
      original - the original item
      Returns:
      the modified item