withMeta

@Contract(value = "_ -> new", pure = true)
inline fun ItemStack.withMeta(builder: ItemMeta.Builder.() -> Unit): 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)
@JvmName(name = "withMetaGeneric")
inline fun <B : IMB<B, P>, P : IMP<B>, ItemMeta> ItemStack.withMeta(builder: B.() -> Unit): ItemStack

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

Return

a new item stack

Parameters

B

the builder type

P

the metadata type

builder

the builder to apply