Arcane Crafting
Arcane crafting is performed at the Arcane Workbench. It requires Vis (aspect energy) to complete and is gated behind research. Recipes are registered via the Thaumcraft API.
Registration
// Shaped (fixed grid pattern)
ThaumcraftApi.addArcaneCraftingRecipe(String research, ItemStack result,
AspectList aspects, Object... recipe)
// Shapeless (order-independent)
ThaumcraftApi.addShapelessArcaneCraftingRecipe(String research, ItemStack result,
AspectList aspects, Object... recipe)
Recipe Format
The Object... recipe varargs encode both the shape (string rows) and ingredient mappings (character → item).
| Token | Meaning |
|---|---|
String row (e.g. "ABA") |
One row of the 3×3 grid; spaces are empty |
Character, ItemStack |
Maps a character to a specific item |
Character, Item |
Maps a character to any Item |
Character, Block |
Maps a character to any Block |
Character, String |
Maps a character to an Ore Dictionary entry |
Boolean.FALSE (first arg) |
Disables mirroring |
Example: Shaped
// Mirror disabled, 3×2 pattern
new ShapedArcaneRecipe("RESEARCH_KEY",
new ItemStack(Items.diamond_sword),
new AspectList().add(Aspect.FIRE, 10).add(Aspect.AIR, 5),
Boolean.FALSE, new Object[] {
" T ", " T ", " S ",
'T', Items.diamond,
'S', Blocks.log
});
Example: Shapeless
new ShapelessArcaneRecipe("RESEARCH_KEY",
new ItemStack(Items.diamond),
new AspectList().add(Aspect.EARTH, 8),
Items.diamond, Blocks.dirt); // order doesn't matter
IArcaneRecipe Interface
public interface IArcaneRecipe {
boolean matches(IInventory var1, World world, EntityPlayer player);
ItemStack getCraftingResult(IInventory var1);
int getRecipeSize();
ItemStack getRecipeOutput();
AspectList getAspects();
AspectList getAspects(IInventory var1);
String getResearch();
}
| Method | Returns | Notes |
|---|---|---|
matches |
boolean |
Checks if crafting grid satisfies the recipe |
getCraftingResult |
ItemStack |
Returns the crafted output (copy) |
getRecipeSize |
int |
Number of recipe ingredients |
getRecipeOutput |
ItemStack |
The base recipe output |
getAspects |
AspectList |
Vis cost for the recipe |
getResearch |
String |
Research key required to craft |
ShapedArcaneRecipe
A shaped recipe where ingredient positions matter. Grid is up to 3×3.
Fields:
| Field | Type | Description |
|---|---|---|
output |
ItemStack |
Crafted result |
input |
Object[] |
Flattened ingredient array |
aspects |
AspectList |
Vis cost |
research |
String |
Required research key |
width |
int |
Pattern width (1–3) |
height |
int |
Pattern height (1–3) |
mirrored |
boolean |
Whether recipe mirrors horizontally (default true) |
Constructors:
ShapedArcaneRecipe(String research, Block result, AspectList aspects, Object... recipe)
ShapedArcaneRecipe(String research, Item result, AspectList aspects, Object... recipe)
ShapedArcaneRecipe(String research, ItemStack result, AspectList aspects, Object... recipe)
Disabling mirroring:
recipe.setMirrored(false);
ShapelessArcaneRecipe
A shapeless recipe where ingredient positions do not matter. All items in the crafting grid are pooled.
Fields:
| Field | Type | Description |
|---|---|---|
output |
ItemStack |
Crafted result |
input |
ArrayList |
List of required ingredients |
aspects |
AspectList |
Vis cost |
research |
String |
Required research key |
Constructors:
ShapelessArcaneRecipe(String research, Block result, AspectList aspects, Object... recipe)
ShapelessArcaneRecipe(String research, Item result, AspectList aspects, Object... recipe)
ShapelessArcaneRecipe(String research, ItemStack result, AspectList aspects, Object... recipe)
Obtaining Recipes
// Iterate all arcane recipes
for (Object r : ThaumcraftApi.getCraftingRecipes()) {
if (r instanceof IArcaneRecipe) {
IArcaneRecipe recipe = (IArcaneRecipe) r;
// ...
}
}
Vis Cost
Vis costs are defined as an AspectList. Each entry specifies an aspect and the amount of Vis required from that aspect pool. The total Vis consumed is the sum of all aspect amounts.
new AspectList()
.add(Aspect.FIRE, 10)
.add(Aspect.AIR, 5)
.add(Aspect.ORDER, 3);