withMeta

@Contract(value = "_ -> new", pure = true)
abstract fun withMeta(meta: ItemMeta): ItemStack

Creates a new item stack with the given meta.

Return

a new item stack

Parameters

meta

the new meta


@Contract(value = "_ -> new", pure = true)
open fun withMeta(builder: Consumer<ItemMeta.Builder>): ItemStack

Creates a new item stack with meta retrieved applying the given builder to a new item metadata builder.

Return

a new item stack

Parameters

builder

the builder to apply


@Contract(value = "_, _ -> new", pure = true)
open fun <B : ItemMetaBuilder<B, P>, P : ItemMetaBuilder.Provider<B>, ItemMeta> withMeta(type: Class<P>, builder: Consumer<B>): ItemStack

Creates a new item stack with meta retrieved applying the given builder to a new meta builder created with the given type.

Return

a new item stack

Parameters

B

the builder type

P

the metadata type

type

the type

builder

the builder to apply