ItemStackBuilder

Helper class for creating an ItemStack, including utilities for creating Pylon items specifically.

Implements InvUI's ItemProvider, so can be used instead of an ItemStack in GUIs.

You should use this when using anything to do with Component.translatable including io.github.pylonmc.pylon.core.item.PylonItems in InvUI GUIs. Yes, this is confusing and annoying - it is unfortunately necessary to get around InvUI's translation system.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Adds a color to the item's custom model data, used in resource packs.

Link copied to clipboard

Adds a boolean to the item's custom model data, used in resource packs.

Link copied to clipboard

Adds a float to the item's custom model data, used in resource packs.

Link copied to clipboard

Adds a string to the item's custom model data, used in resource packs.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Sets the item's lore to the default language file key (for example pylon.pyloncore.item.my_dumb_item.lore), based on the item key given.

Link copied to clipboard

Sets the item's name to the default language file key (for example pylon.pyloncore.item.my_dumb_item.name), based on the item key given.

Link copied to clipboard
fun <T : Any> editData(type: DataComponentType.Valued<T>, block: (T) -> T): ItemStackBuilder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open operator override fun get(lang: String?): ItemStack

Ignore this method; InvUI item provider implementation.

@NotNull
open override fun get(): @NotNull ItemStack
Link copied to clipboard
fun lore(vararg lore: String): ItemStackBuilder
fun lore(vararg loreToAdd: ComponentLike): ItemStackBuilder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard