Builder

For building new ItemStacks.

Functions

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
abstract fun amount(amount: Int): ItemStack.Builder

Sets the amount of items in the ItemStack being built.

Link copied to clipboard
@Contract(value = "_ -> new", pure = true)
abstract override fun build(): ItemStack

Builds a new ItemStack with the settings retrieved from this builder.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
open fun meta(builder: Consumer<ItemMeta.Builder>): ItemStack.Builder
@Contract(value = "_, _ -> this", mutates = "this")
open fun <B : ItemMetaBuilder<B, P>, P : ItemMetaBuilder.Provider<B>, ItemMeta> meta(type: Class<P>, builder: Consumer<B>): ItemStack.Builder

Applies the given builder function to the metadata builder for this builder.

@Contract(value = "_ -> this", mutates = "this")
abstract fun meta(meta: ItemMeta): ItemStack.Builder

Sets the metadata for the item stack to the given meta.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
@JvmName(name = "metaGeneric")
inline fun <B : IMB<B, P>, P : IMP<B>, ItemMeta> ItemStack.Builder.meta(builder: B.() -> Unit): ItemStack.Builder
@Contract(value = "_ -> this", mutates = "this")
inline fun ItemStack.Builder.meta(builder: ItemMeta.Builder.() -> Unit): ItemStack.Builder

Applies the given builder function to the metadata builder for this builder.

Link copied to clipboard
@Contract(value = "_ -> this", mutates = "this")
abstract fun type(type: ItemType): ItemStack.Builder

Sets the type of the ItemStack being built.