Wand Caps
thaumcraft.api.wands.WandCap
Wand caps (cappings) determine a wand’s vis discount and crafting cost. Caps are registered statically and used to generate wand crafting recipes.
WandCap
Fields
| Field | Type | Description |
|---|---|---|
baseCostModifier |
float |
Multiplier for all aspect costs. Higher = more expensive. 1.0 = normal cost. |
specialCostModifierAspects |
List<Aspect> |
Primal aspects that use a special discount rate. |
specialCostModifier |
float |
Discount multiplier for the specified aspects. |
craftCost |
int |
Crafting cost added to the wand’s total craft cost. |
texture |
ResourceLocation |
Texture path: thaumcraft:textures/models/wand_cap_<tag>.png. |
item |
ItemStack |
The crafting ingredient that forms the cap. |
Key Methods
| Method | Description |
|---|---|
getBaseCostModifier() |
Returns the base cost multiplier. |
getSpecialCostModifierAspects() |
Returns list of aspects using the special discount. |
getSpecialCostModifier() |
Returns the special cost multiplier. |
getCraftCost() |
Returns crafting cost. |
getTexture() |
Returns the ResourceLocation of the cap’s texture. |
getItem() |
Returns the ItemStack used as the crafting ingredient. |
getResearch() |
Returns "CAP_" + tag. Player must complete this research to craft the wand. |
Constructors
// Basic constructor (uniform discount for all aspects)
new WandCap(String tag, float discount, ItemStack item, int craftCost)
// Advanced constructor (different discount for specific aspects)
new WandCap(String tag, float discount, List<Aspect> specialAspects, float discountSpecial, ItemStack item, int craftCost)
Static Registry
public static LinkedHashMap<String, WandCap> caps
All registered caps. Keyed by tag string.
Cost Modifier System
The wand cap’s discount system works as follows:
- Base discount (
baseCostModifier): Applied to all aspect costs. - Special discount (
specialCostModifier): Applied only to specific primal aspects listed inspecialCostModifierAspects.
Example
// Iron cap: 1.1x cost for all aspects except ORDER, which gets 1x
new WandCap("iron", 1.1f,
Arrays.asList(Aspect.ORDER), 1.0f,
new ItemStack(ConfigItems.itemWandCap, 1, 0), 1);
Discount vs. Cost
The modifier is a cost multiplier (not a discount):
1.0= normal cost (no modifier)0.9= 10% cheaper1.1= 10% more expensive
A lower baseCostModifier is generally better for wand efficiency.
Known Cap Types
⚠️ 已订正(原表几乎全为编造) 原条目以「The following cap types are registered in the main Thaumcraft mod」为标题, 列了 8 行杖帽数据。本 API 仓内没有任何实际注册过的杖帽——
WandCap.caps是个空的LinkedHashMap(wands/WandCap.java:51),只有构造器执行时caps.put(tag, this)才会写入 (wands/WandCap.java:59/70),而本仓不创建任何WandCap实例。原表里有源码依据的只有 2 行,且它们来自
WandCap.java:126-127里被注释掉的示例代码, 不是注册项:
Tag Base Cost Modifier Special Aspects Craft Cost 证据 iron1.1f [Aspect.ORDER]1 wands/WandCap.java:126(注释行)gold1.0f — 3 wands/WandCap.java:127(注释行)注意
iron行的实际构造是new WandCap("iron", 1.1f, Arrays.asList(Aspect.ORDER), 1, new ItemStack(ConfigItems.itemWandCap,1,0), 1)(specialCost=1、配方物是itemWandCap伤害值 0、craftCost=1)。其余 6 行(
brass/copper/silver/thaumium/void/wood)的全部数值无法核实, 已删除;原表里的???占位符也一并清除。
Crafting
Wand caps are combined with wand rods in Thaumcraft’s arcane crafting system to produce complete wands. The crafting recipe is automatically generated based on the registered item and craftCost values for both the rod and cap.
Research Requirement
To craft a wand with a specific cap, the player must complete research keyed at "CAP_<tag>" (e.g. "CAP_iron").
Example Registration
// Register a gold cap with 1.0 base cost modifier (no discount)
// ⚠️ 下面这行是 WandCap.java:127 中**被注释掉的官方示例**,不是已注册的杖帽
WandCap WAND_CAP_GOLD = new WandCap(
"gold", // tag
1.0f, // base cost modifier
new ItemStack(ConfigItems.itemWandCap, 1, 1), // gold wand cap item
3 // craft cost
);