Companion

Functions

Link copied to clipboard
inline fun <T : RebarItem> from(stack: ItemStack?): T?
Link copied to clipboard
@Contract(value = "null -> null")
fun fromStack(stack: ItemStack?): RebarItem?

Gets a RebarItem from an ItemStack if the item is a Rebar item Returns null if the ItemStack is not a Rebar item

@Contract(value = "null -> null")
fun <T : RebarItem> fromStack(stack: ItemStack?, clazz: Class<T>): T?

Converts a regular ItemStack to a RebarItem of class clazz Returns null if the ItemStack is not a Rebar item or is not of the specified clazz

Link copied to clipboard
Link copied to clipboard
@Contract(value = "null -> false")
fun isRebarItem(stack: ItemStack?): Boolean

Checks if stack is a Rebar item.

Link copied to clipboard
inline fun <T : RebarItem> register(template: ItemStack, rebarBlockKey: NamespacedKey? = null)
fun register(itemClass: Class<out RebarItem>, template: ItemStack, rebarBlockKey: NamespacedKey? = null)
Link copied to clipboard

Suppresses warnings about missing/incorrect translation keys for the item name and lore for the given item key