Interface ItemType.Typed<M extends ItemMeta>

Type Parameters:
M - the generic type of the item meta that represents the item type.
All Superinterfaces:
ItemType, Keyed, Translatable
Enclosing interface:
ItemType

public static interface ItemType.Typed<M extends ItemMeta> extends ItemType
Typed represents a subtype of ItemTypes that have a known item meta type at compile time.
  • Method Details

    • getItemMetaClass

      @NotNull Class<M> getItemMetaClass()
      Gets the ItemMeta class of this ItemType
      Specified by:
      getItemMetaClass in interface ItemType
      Returns:
      the ItemMeta class of this ItemType
    • createItemStack

      @NotNull ItemStack createItemStack(@Nullable Consumer<? super M> metaConfigurator)
      Constructs a new item stack with this item type with the amount 1.
      Parameters:
      metaConfigurator - an optional consumer of the items ItemMeta that is called. May be null if no intent exists to mutate the item meta at this point.
      Returns:
      the created and configured item stack.
    • createItemStack

      @NotNull ItemStack createItemStack(int amount, @Nullable Consumer<? super M> metaConfigurator)
      Constructs a new item stack with this item type.
      Parameters:
      amount - the amount of itemstack.
      metaConfigurator - an optional consumer of the items ItemMeta that is called. May be null if no intent exists to mutate the item meta at this point.
      Returns:
      the created and configured item stack.