Charge Buffer
基本信息
| 属性 | 值 |
|---|---|
| NBT ID | charge_buffer(主键) |
| 别名 ID | Charge Buffer |
| 研究页 | WAND_AUGMENTATION_CHARGE_BUFFER |
| 注魔配方名 | TM_WA_CHARGE_BUFFER |
| 注魔不稳定性 | 12 |
| 前置改装 | 无(getPrerequisiteAugmentations() 返回 null) |
| 杖身兼容 | 全部(isCompatibleWith(WandRod) 恒 true) |
| 实际效果 | 已实现 —— Vis 容量 × 1.25 |
效果
通过 GTNH Mixin 改写 Thaumcraft 的 ItemWandCasting.getMaxVis(ItemStack):
@WrapMethod(method = "getMaxVis")
public int tm$chargeBuffer(ItemStack stack, Operation<Integer> original) {
Integer capacity = original.call(stack);
// * 5 / 4 == *= 1.25 with int math
return WandHelper.hasAugmentation(stack, AugmentationChargeBuffer.INSTANCE)
? capacity * 5 / 4 : capacity;
}
乘法用 int 运算 capacity * 5 / 4,故对低容量法杖有截断:容量 1→1、2→2、3→3、4→5、7→8、8→10。mixins/late/thaumcraft/common/items/wands/MixinItemWandCasting_Augmentations.java:26-31。
同一 mixin 还覆写 ItemWandCasting.hasRunes,使任何带 Augmentation 的法杖都被判定为「有符文」从而渲染符文(:64-67)。
注魔配方
由 TMObjects.loadInfusionRecipes() 循环统一注册(core/TMObjects.java:51-61),每个改装注册两条 RecipeInfusionWandAugmentation:isResearchRecipe = false 进 ThaumcraftApi.getCraftingRecipes(),isResearchRecipe = true 进 ConfigResearch.recipes(研究配方会额外写入前置改装)。
| 项 | 值 |
|---|---|
| 要素需求 | TOOL 16 / MAGIC 24 / ENERGY 32 / VOID 48 |
| 不稳定性 | 12 |
| 材料 | ConfigBlocks.blockMagicalLog meta 1 × 1 |
| 中心物品 | ConfigItems.itemWandCasting meta 32767(Short.MAX_VALUE) |
数值
| 数值 | 值 |
|---|---|
| Vis 容量倍率 | × 1.25(int:* 5 / 4) |
| 注魔不稳定性 | 12 |
| 要素 | TOOL 16 / MAGIC 24 / ENERGY 32 / VOID 48 |
| 材料数量 | 1 |
| 前置改装 | 无 |
与其它改装的关系
hasAugmentations副作用:MixinItemWandCasting_Augmentations.hasRunes让所有改装(不只是本条)都能显示符文。- 前置链上无依赖;但 Taint Capping 以 Tainted Core 为前置,与本条平行。
源码缺陷
- int 截断:
capacity * 5 / 4对小容量法杖不是精确的 1.25 倍。源码注释承认是 int 运算(:29),但未做向下/向上取整说明。 handleAugmentation(ItemStack, ItemWandCasting)是空实现(wand/augmentation/AugmentationChargeBuffer.java:58)。全部效果靠 mixin,IAugmentationWand的默认回调被闲置 —— 这使得任何不加载 mixin 的环境(coreMod 缺失)下本改装完全无效,且接口契约与实现分家。
相关条目
- Vis Channel - 另一条已实现的改装
- Taint Capping - 已实现的高级改装
- Tainted Core - 无实现的「前置」改装
- 符文渲染 Mixin - 同一 Mixin 体系下的表现修正