Package com.hbm_m.recipe
Class CrucibleRecipe
java.lang.Object
com.hbm_m.recipe.CrucibleRecipe
- Direct Known Subclasses:
CrucibleAlloyingRecipe
Modern port of legacy
CrucibleRecipe extends GenericRecipe.
Each recipe has a name (used as a translation key), a display icon,
a frequency (relative weight for JEI ordering) and immutable input / output
item lists.
MaterialStack TODO: The legacy class stored MaterialStack[] arrays so
that amounts were expressed in the Mats unit system (mB-like). Once
com.hbm_m.inventory.material.Mats and MaterialStack are ported, replace
List<ItemStack> with MaterialStack[] and restore getInputAmount().
Builder usage (mirrors legacy API):
CrucibleRecipe recipe = new CrucibleRecipe("steel_alloy")
.setup(1, new ItemStack(ModItems.INGOT_STEEL.get()))
.inputs(ironStack, carbonStack)
.outputs(steelStack);
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemStackgetIcon()intReturns the total number of input items across all input stacks.List<net.minecraft.world.item.ItemStack>Returns a human-readable name derived from the recipe's name key.List<net.minecraft.world.item.ItemStack>Sets the input item list from an existing collection.inputs(net.minecraft.world.item.ItemStack... inputs) Sets the input item list.Sets the output item list from an existing collection.outputs(net.minecraft.world.item.ItemStack... outputs) Sets the output item list.setup(int frequency, net.minecraft.world.item.ItemStack icon) Sets the frequency weight and the display icon.
-
Field Details
-
name
Internal identifier / translation-key base (mirrorsGenericRecipe.name). -
frequency
public int frequencyRelative processing frequency / weight. Higher values mean the recipe is attempted more often in random-pick scenarios. Default: 1.
-
-
Constructor Details
-
CrucibleRecipe
-
-
Method Details
-
setup
Sets the frequency weight and the display icon.- Parameters:
frequency- relative weight (≥ 1)icon- display ItemStack shown in JEI / recipe selector- Returns:
thisfor chaining
-
inputs
Sets the input item list. Defensive copy is made. -
inputs
Sets the input item list from an existing collection. Defensive copy is made. -
outputs
Sets the output item list. Defensive copy is made. -
outputs
Sets the output item list from an existing collection. Defensive copy is made. -
getInputs
-
getOutputs
-
getIcon
public net.minecraft.world.item.ItemStack getIcon() -
getInputAmount
public int getInputAmount()Returns the total number of input items across all input stacks. In the legacy code this summedMaterialStack.amountvalues; here it sumsItemStack.getCount()as a placeholder.TODO: once MaterialStack is ported, sum
MaterialStack.amountinstead. -
getLocalizedName
Returns a human-readable name derived from the recipe's name key.
-