铸件配方

本 mod 的"铸件"有两个来源:TiC 自己的浇铸系统(砧台 / 浇铸台)与 GregTech 的机器。 本条目覆盖后者——把 GT 的黄铜板 / 金板和熔融黄铜 / 熔融金接到 TiC 的铸件体系上。

注册入口:TGregRecipeRegistry.registerCastRecipes()(postInit 阶段), 外加 addGregTechPartRecipes() 结尾为 碎片铸件 注册的 3 条挤压机配方。

唯一参与铸件制造的两种材料

Materials[] castingMaterials = { Materials.Brass, Materials.Gold };

只有黄铜与金能制铸件。这两种材料不是工具材料(不在 toolMaterials 里), 它们只作为"铸件金属"出现。

配方矩阵

# 机器 输入 输出 时长 电压 开关 默认
1 GT 挤压机 1 × 黄铜板/金板 + TiC 部件铸件 pattern 1 × 该部件的 TiC 版铸件(通配 Short.MAX_VALUE) 800 getPowerRequired(黄铜/金) castExtruderRecipes 见下
2 GT 挤压机 1 × 黄铜板/金板 + TGregworks 部件 pattern 1 × 该部件的 TGregworks 版铸件(通配 Short.MAX_VALUE) 800 同上 castExtruderRecipes 见下
3 GT 流固机 1000 mB 熔融黄铜/金 + TiC 部件铸件 pattern 1 × 该部件的 TiC 版铸件 800 同上 castSolidifierRecipes false
4 GT 流固机 1000 mB 熔融黄铜/金 + TGregworks 部件 pattern 1 × 该部件的 TGregworks 版铸件 800 同上 castSolidifierRecipes false
5 GT 挤压机 1 × 黄铜板/金板 + 碎片铸件 n(1) = 2 × 该材料碎片 800 同上 castExtruderRecipes 见下
6 GT 流固机 1000 mB 熔融黄铜/金 + 碎片铸件 2 × 该材料碎片 800 同上 castSolidifierRecipes false
7 GT 挤压机 1 × blankPattern(meta 1) + 1 × 黑曜石碎片 1 × 碎片铸件 800 round(30 × 倍率) tinkersconstructcastrecipe true
8 GT 挤压机 1 × blankPattern(meta 2) + 1 × 黑曜石碎片 1 × 碎片铸件 800 round(30 × 倍率) tinkersconstructcastrecipe true
9 GT 挤压机 1 × 黄铜板 + 1 × 黑曜石碎片 1 × 碎片铸件 800 round(30 × 倍率) tinkersconstructcastrecipe 且 !castExtruderRecipes true / 条件
10 工作台 黄铜板 + 硬锤 + 刀 + 锉(GT ToolDictNames) 1 × 碎片铸件 — — gregtechcastrecipe true

通配 metadata

配方 1/2/3/4 的 pattern 槽写的是:

  • 配方 1/3:new ItemStack(p.getCounterpart(), 0, Short.MAX_VALUE) —— TiC 原版部件的铸件 pattern
  • 配方 2/4:new ItemStack(TGregworks.registry.toolParts.get(p), 0, Short.MAX_VALUE) —— 本 mod 部件的 pattern

metadata = Short.MAX_VALUE(32767)是有意的通配写法:GT 匹配 recipe 时把它当"任意 subtype", 这样任何材料(任何 damage)的部件都能被同一张配方匹配。真正决定产出材料的是输入槽的 material NBT。

配方 5/6 同样用 new ItemStack(toolParts.get(PartTypes.Chunk), 0, Short.MAX_VALUE) 作为 输出, 而输入是 new ItemStack(TGregworks.shardCast, 1, 0)。

Chunk 的特殊处理

PartTypes.Chunk(碎片)的 pattern 是 null,所以在配方 1–4 的循环里 if (stack != null && stack.getItem() != null) 判空后被跳过。 碎片铸件因此有独立的配方 5/6(用 PartTypes.Chunk 的部件 pattern 作 pattern 槽, 但输出是"用碎片铸件造碎片")。

电压的两个分档

场景 电压
配方 1–6(黄铜/金) getPowerRequired(m):mToolQuality < 3 ? 30 : 120 × 倍率
配方 7–9(碎片铸件) Math.round(30 × energyMultiplier) —— 恒 30,不分档

黄铜的 mToolQuality 与金的 mToolQuality 都是 0(不是工具材料), 但 getPowerRequired 里的 sanitize 不会用到(它直接判 m.mToolQuality < 3), 所以黄铜/金实际是 30 × 倍率,与配方 7–9 相同。

熔融量

Materials.getMolten(GT_Values.L) = 1000 mB(整整 1 桶),与部件配方的 288 × price 不同。 流固机配方还有一句 stack.stackSize = 1; 把 pattern 的数量压到 1(挤压机没有这句)。

castExtruderRecipes 的动态默认值

addCastExtruderRecipes = config.getBoolean("…castExtruderRecipes", extruder, CastLegacy.metalPattern != null, …)
  • 装了 Tinkers’ Smeltery → CastLegacy.metalPattern == null → 默认 false (铸件已有 TiC 官方版本,GT 侧不必再压);
  • 无 Smeltery → 默认 true(此时 23 个 legacy 铸件只能靠这组配方做出来)。

副作用是配方 9(黄铜板 + 黑曜石碎片 → 碎片铸件)的条件 !addCastExtruderRecipes: 只有在"铸件系统不可用"时才补这一条,与配方 5 互斥,两者永远只存在一条。

相关条目