AllCandidateUIDesigner

Interface for customizing the AllCandidateUI, which displays all craft recipe candidates.

All methods have default implementations, so only the parts that need customization must be overridden; the rest fall back to the default behavior.

Internally, bake receives a Context and produces a Baked instance with all values resolved. If the resulting Baked fails validation (contradictory or out-of-range values), a Baked built entirely from default values is used instead.

Since

5.2.0

See also

Types

Link copied to clipboard
class Baked(val title: Component, val recipeSlots: Set<CoordinateComponent>, val previousPageButton: Pair<CoordinateComponent, ItemStack>, val nextPageButton: Pair<CoordinateComponent, ItemStack>, val backToCraftUIButton: Pair<CoordinateComponent, ItemStack>, val noDisplayableItem: ItemStack, val ungeneratedIconPlaceholderItem: (CRecipe) -> ItemStack)

An immutable snapshot of a resolved AllCandidateUIDesigner with all values fixed at bake time.

Link copied to clipboard
object Companion
Link copied to clipboard
data class Context(val searchResult: Search.SearchResult, val crafterId: UUID)

Context provided when baking an AllCandidateUIDesigner into a fixed-value Baked instance.

Functions

Link copied to clipboard

Returns the slot coordinate and icon item for the button that navigates back to the CraftUI.

Link copied to clipboard

Bakes this designer's values with the given context into an immutable Baked instance.

Link copied to clipboard

Bakes a context with Context.emptyContext. Shorthand of .bake(Context.emptyContext)

Link copied to clipboard

Returns the slot coordinate and icon item for the next-page button.

Link copied to clipboard

Returns the icon item shown in recipe slots where the recipe cannot produce a displayable item.

Link copied to clipboard

Returns the slot coordinate and icon item for the previous-page button.

Link copied to clipboard

Returns the set of slot coordinates where recipe icons can be placed.

Link copied to clipboard
open fun title(context: AllCandidateUIDesigner.Context): Component

Returns the title Component of the AllCandidateUI inventory.

Link copied to clipboard

Returns a lambda that produces a placeholder icon for recipe slots whose result item has not yet been generated.