Class ItemBuilder<T>

java.lang.Object
me.hsgamer.hscore.minecraft.item.ItemBuilder<T>
Type Parameters:
T - the type of the item
Direct Known Subclasses:
BukkitItemBuilder

public abstract class ItemBuilder<T> extends Object
The item builder
  • Constructor Details

    • ItemBuilder

      public ItemBuilder()
  • Method Details

    • getDefaultItem

      @NotNull protected abstract T getDefaultItem()
      Get the default item
      Returns:
      the default item
    • addItemModifier

      @Contract("_ -> this") public ItemBuilder<T> addItemModifier(ItemModifier<T> modifier)
      Add an item modifier
      Parameters:
      modifier - the item modifier
      Returns:
      this for builder chain
    • removeItemModifier

      @Contract("_ -> this") public ItemBuilder<T> removeItemModifier(ItemModifier<T> modifier)
      Remove an item modifier
      Parameters:
      modifier - the item modifier
      Returns:
      this for builder chain
    • getItemModifiers

      public List<ItemModifier<T>> getItemModifiers()
      Get the map of item modifiers
      Returns:
      the item modifiers
    • getStringReplacers

      public List<StringReplacer> getStringReplacers()
      Get the list of string replacers
      Returns:
      the string replacers
    • addStringReplacer

      @Contract("_ -> this") public ItemBuilder<T> addStringReplacer(StringReplacer replacer)
      Add a string replacer
      Parameters:
      replacer - the string replacer
      Returns:
      this for builder chain
    • removeStringReplacer

      @Contract("_ -> this") public ItemBuilder<T> removeStringReplacer(StringReplacer replacer)
      Remove a string replacer
      Parameters:
      replacer - the string replacer
      Returns:
      this for builder chain
    • build

      public T build(@Nullable @Nullable UUID uuid)
      Build the item
      Parameters:
      uuid - the unique id
      Returns:
      the item
    • build

      public T build()
      Build the item
      Returns:
      the item