Skip to content

RecipePattern

roidrole edited this page Jul 22, 2025 · 11 revisions

A cool new way to add recipes!

It's similar to how you register recipes using JSON.

Importing class

import mods.ctintegration.util.RecipePattern;

Methods

Method Description
static RecipePattern init(String[] recipePattern) returns a RecipePattern instance with the given pattern
static RecipePattern init(IItemStack output, String[] recipePattern)
static RecipePattern init(String name, IItemStack output, String[] recipePattern)
RecipePattern with(String character, IIngredient ingredient) maps a character to an IIngredient. the string must only contain one character!
RecipePattern and(String character, IIngredient ingredient) same as with, but cooler
RecipePattern withOutput(IItemStack output) sets the output
RecipePattern setMirrored(boolean isMirrored) sets if the recipe is mirrored
RecipePattern setName(String name) sets the recipe name
RecipePattern setShapeless(boolean isShapeless) If the reicipe is shapeless, all lines in the pattern will be combined into one line and whitespaces will be ignored
RecipePattern setFunction(IRecipeFunction function) sets the RecipeFunction
RecipePattern setFunction(IRecipeAction action) sets the RecipeAction
RecipePattern map(Map<String, IIngredient> mapping) map multiple characters at once with CraftTweaker's Map
void build() call this after everything is set up, this registers the craft table recipe you have just defined.

Note : whitespace characters are always mapped to null

Zen Getters

Getter Name Return Type description
ingredients IIngredient[][] retrieves the 2d array of IIngredient from the mapping
shapelessIngredients IIngredient[] same as above but is for shapeless recipes and is an 1d array. You can call this without calling setShapeless(true).

Clone this wiki locally