Class RecipeRegistration
java.lang.Object
ke.ric.api.registration.RecipeRegistration
API for registering custom recipes programmatically.
Addon recipes are stored separately and can be browsed in the cookbook
under their addon's category.
Usage:
api.recipes().register(RecipeRegistration.builder()
.id("STOMP_GRAPES")
.addonId("distillery") // Groups recipes by addon
.stationName("Stomping Tub") // Display name for the station
.stationTexture("http://...") // Optional texture for station icon
.output("GRAPE_MUST")
.processingTime(300) // 15 seconds (in ticks)
.addIngredient("RENOIT_GRAPE", true, 4) // Required, up to 4);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn addon recipe with custom station information.static classBuilder for creating addon recipes.static final record -
Method Summary
Modifier and TypeMethodDescriptionstatic RecipeActionCreate a rule action.builder()Create a new recipe builder.static RuleMatchercustomItemMatcher(String customItemId) Create a Heirloom custom-item rule matcher.booleanhasOutputDecorator(String addonId, String recipeId) inspectFile(File recipeFile, String defaultAddonId, Predicate<String> customItemExists) Parse an editable addon recipe file through Core's runtime parser and validate every typed item reference without changing registered state.static RecipeActionnameAction(String displayName) Create a display-name override action.booleanRegister an addon recipe.voidregisterAll(RecipeRegistration.AddonRecipeBuilder... builders) Register multiple recipes at once.registeredIds(String addonId) Return recipe IDs owned by an addon after override arbitration.voidregisterEligibilityPredicate(String recipeId, RecipeEligibilityPredicate predicate) Register an addon-owned eligibility gate.intregisterFromFile(File recipeFile, String defaultAddonId) Register addon recipes from an editable JSON file.voidregisterOutputDecorator(String addonId, String recipeId, RecipeOutputDecorator decorator) Unregister an addon's recipes.voidregisterOutputHandler(String recipeId, CustomOutputHandler handler) Register a custom output handler for a specific recipe.voidSuppress a recipe while the owning addon remains registered.voidunregisterAddon(String addonId) voidunregisterEligibilityPredicate(String recipeId) voidunregisterOutputHandler(String recipeId) Unregister a custom output handler.static RuleMatchervanillaItemMatcher(String materialId) Create a vanilla-material rule matcher.static RecipeActionvisualAction(String visualId) Create a provider-neutral visual swap action.
-
Method Details
-
register
Register an addon recipe.- Parameters:
builder- The recipe builder- Returns:
- true if registered successfully
-
registerAll
Register multiple recipes at once. -
registerOutputDecorator
public void registerOutputDecorator(String addonId, String recipeId, RecipeOutputDecorator decorator) Unregister an addon's recipes. -
hasOutputDecorator
-
unregisterAddon
-
suppress
Suppress a recipe while the owning addon remains registered. Suppressions use the same override-strength arbitration as replacement recipes and are removed byunregisterAddon(String). -
registerFromFile
-
registeredIds
-
inspectFile
public static RecipeRegistration.RecipeFileInspection inspectFile(File recipeFile, String defaultAddonId, Predicate<String> customItemExists) Parse an editable addon recipe file through Core's runtime parser and validate every typed item reference without changing registered state. -
registerOutputHandler
Register a custom output handler for a specific recipe. When the recipe is crafted, this handler will be called instead of the standard output creation. This allows addons to preserve metadata from input items (like LiquidProfile for brewing). Example usage:api.recipes().registerOutputHandler("BOIL_GRAIN_WORT", (recipe, inputs) -> { // Extract data from input LiquidProfile profile = LiquidProfile.loadFromItem(inputs.get(0)); // Create proper output with preserved data ItemStack output = api.createItem("BOILED_GRAIN_WORT"); profile.saveToItem(output); return output; });- Parameters:
recipeId- The recipe ID (case-insensitive)handler- The handler that creates the output item from inputs
-
unregisterOutputHandler
Unregister a custom output handler. -
registerEligibilityPredicate
Register an addon-owned eligibility gate. The gate runs after ordinary ingredient matching but before a station reserves any inputs. -
unregisterEligibilityPredicate
-
builder
Create a new recipe builder. -
vanillaItemMatcher
Create a vanilla-material rule matcher. -
customItemMatcher
Create a Heirloom custom-item rule matcher. -
action
Create a rule action. -
visualAction
Create a provider-neutral visual swap action. -
nameAction
Create a display-name override action.
-