Interface AllCandidateUIDesigner
-
- All Implemented Interfaces:
public interface AllCandidateUIDesignerInterface 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classAllCandidateUIDesigner.ContextContext provided when baking an AllCandidateUIDesigner into a fixed-value Baked instance.
public final classAllCandidateUIDesigner.BakedAn immutable snapshot of a resolved AllCandidateUIDesigner with all values fixed at bake time.
Obtained by calling bake or bakeWithEmptyContext. If any value fails isValid, the system falls back to a Baked built entirely from the DEFAULT designer.
public classAllCandidateUIDesigner.Companion
-
Method Summary
Modifier and Type Method Description Componenttitle(AllCandidateUIDesigner.Context context)Returns the title Component of the AllCandidateUI inventory. Pair<CoordinateComponent, ItemStack>previousPageButton(AllCandidateUIDesigner.Context context)Returns the slot coordinate and icon item for the previous-page button. Pair<CoordinateComponent, ItemStack>nextPageButton(AllCandidateUIDesigner.Context context)Returns the slot coordinate and icon item for the next-page button. Pair<CoordinateComponent, ItemStack>backToCraftUIButton(AllCandidateUIDesigner.Context context)Returns the slot coordinate and icon item for the button that navigates back to the CraftUI. Set<CoordinateComponent>recipeSlots(AllCandidateUIDesigner.Context context)Returns the set of slot coordinates where recipe icons can be placed. ItemStacknoDisplayableItem(AllCandidateUIDesigner.Context context)Returns the icon item shown in recipe slots where the recipe cannot produce a displayable item. Function<CRecipe, ItemStack>ungeneratedIconPlaceholderItem(AllCandidateUIDesigner.Context context)Returns a factory that produces a placeholder icon for recipe slots whose result item has not yet been generated. -
-
Method Detail
-
title
Component title(AllCandidateUIDesigner.Context context)
Returns the title Component of the AllCandidateUI inventory.
- Parameters:
context- Context provided at bake time- Returns:
Component inventory title component
- Since:
5.2.0
-
previousPageButton
Pair<CoordinateComponent, ItemStack> previousPageButton(AllCandidateUIDesigner.Context context)
Returns the slot coordinate and icon item for the previous-page button.
The
Pairused here is a Kotlin class, but can also be constructed from Java asnew Pair<>(element1, element2).- Parameters:
context- Context provided at bake time- Returns:
Pair slot coordinate and icon item for the previous-page button
- Since:
5.2.0
-
nextPageButton
Pair<CoordinateComponent, ItemStack> nextPageButton(AllCandidateUIDesigner.Context context)
Returns the slot coordinate and icon item for the next-page button.
- Parameters:
context- Context provided at bake time- Returns:
Pair slot coordinate and icon item for the next-page button
- Since:
5.2.0
-
backToCraftUIButton
Pair<CoordinateComponent, ItemStack> backToCraftUIButton(AllCandidateUIDesigner.Context context)
Returns the slot coordinate and icon item for the button that navigates back to the CraftUI.
- Parameters:
context- Context provided at bake time- Returns:
Pair slot coordinate and icon item for the back-to-CraftUI button
- Since:
5.2.0
-
recipeSlots
Set<CoordinateComponent> recipeSlots(AllCandidateUIDesigner.Context context)
Returns the set of slot coordinates where recipe icons can be placed.
The set size must be between 1 and 51 inclusive (total inventory slots minus the 3 button slots), and must not include any coordinate occupied by a button.
For example, if 45 recipes are available but this method returns a set of 30 slots, the AllCandidateUI will paginate across 2 pages.
- Parameters:
context- Context provided at bake time- Returns:
Set set of slot coordinates available for recipe icons
- Since:
5.2.0
-
noDisplayableItem
ItemStack noDisplayableItem(AllCandidateUIDesigner.Context context)
Returns the icon item shown in recipe slots where the recipe cannot produce a displayable item.
- Parameters:
context- Context provided at bake time- Returns:
ItemStack placeholder icon item for non-displayable recipes
- Since:
5.2.0
-
ungeneratedIconPlaceholderItem
Function<CRecipe, ItemStack> ungeneratedIconPlaceholderItem(AllCandidateUIDesigner.Context context)
Returns a factory that produces a placeholder icon for recipe slots whose result item has not yet been generated.
The factory receives the CRecipe being displayed and returns the icon ItemStack to show in its slot.
- Parameters:
context- Context provided at bake time- Returns:
Function factory that builds a placeholder icon for the given recipe
- Since:
5.2.0
-
-
-
-