Thermal Expansion 锯木机配方

基本信息

属性 值
插件类 mods.natura.plugins.te4.TE4Pulse(195 行)
@Pulse id "Natura TE4 Compatibility"
modsRequired "ThermalExpansion"(TE4Pulse.java:25)
生命周期 @Handler init(FMLInitializationEvent)(:82)
发送方式 FMLInterModComms.sendMessage("ThermalExpansion", "SawmillRecipe", nbt)
配方条数 84 条(推导见下)

功能

Natura 把自己的木材加工品注册成 Thermal Expansion 锯木机(Sawmill)配方,让锯木机可以直接把原木、木制品回收成木板与锯末,替代原版工作台的木合成。

配方 NBT 结构

createSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int chance)(TE4Pulse.java:30-48)构造如下 NBT:

字段 类型 说明
energy int 耗能
input 物品 NBT 输入
primaryOutput 物品 NBT 主产物
secondaryOutput 物品 NBT 副产物,仅在非 null 时写入
secondaryChance int 副产物概率,仅在有副产物时写入

副产物是 Thermal Expansion 的 sawdust(锯末),通过 GameRegistry.findItemStack("ThermalExpansion", "sawdust", 1) 取得。

6 组配方

组 数量 耗能 主产物 副产物 配置开关
门 6 2400 planks × 6 无 PHNatura.enableWoodenDoors
书架 13 2400 planks × 6 Items.book × 3(100%) enableWoodenBookshelves
工作台 13 2400 planks × 4 无 enableWoodenWorkbenches
栅栏门 13 2400 planks × 2 sawdust(100%) enableWoodenFenceGates
压力板 13 2400 planks × 2 无 enableWoodenPressurePlates
活板门 13 2400 planks × 3 无 enableWoodenTrapdoors
原木 13 800 planks × 6 sawdust(100%) 无条件

合计 6 + 13 + 13 + 13 + 13 + 13 + 13 = 84 条。

[!NOTE] 原木组是唯一耗能 800(其余均 2400)、且不受任何配置开关包裹的一组。

木板 meta 映射

配方用贴图名查木板 meta:list = Arrays.asList(Planks.textureNames)(:83),findPlankForName 返回 indexOf,取不到返回 -1。Planks.textureNames 共 13 项,顺序即 meta 顺序(Planks.java:23-24):

| meta | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | |------|—|—|—|—|—|—|—|—|—|—|—|----|----|----| | 名称 | eucalyptus | sakura | ghostwood | redwood | bloodwood | hopseed | maple | silverbell | purpleheart | tiger | willow | darkwood | fusewood |

NContent.woodTextureNames 是同一份 13 项列表(NContent.java:2017-2018),供书架与工作台循环使用。

逐项映射

栅栏门 / 压力板 / 活板门(各 13 条)都用同一条 方块名 → 木板名 表,只是输入方块不同:

木板名 栅栏门方块 压力板方块 活板门方块
purpleheart fenceGateAmaranth pressurePlateAmaranth trapdoorAmaranth
bloodwood fenceGateBloodwood pressurePlateBloodwood trapdoorBloodwood
darkwood fenceGateDarkwood pressurePlateDarkwood trapdoorDarkwood
eucalyptus fenceGateEucalyptus pressurePlateEucalyptus trapdoorEucalyptus
fusewood fenceGateFusewood pressurePlateFusewood trapdoorFusewood
ghostwood fenceGateGhostwood pressurePlateGhostwood trapdoorGhostwood
hopseed fenceGateHopseed pressurePlateHopseed trapdoorHopseed
maple fenceGateMaple pressurePlateMaple trapdoorMaple
redwood fenceGateRedwood pressurePlateRedwood trapdoorRedwood
sakura fenceGateSakura pressurePlateSakura trapdoorSakura
silverbell fenceGateSilverbell pressurePlateSilverbell trapdoorSilverbell
tiger fenceGateTiger pressurePlateTiger trapdoorTiger
willow fenceGateWillow pressurePlateWillow trapdoorWillow

[!NOTE] 仙人掌(Amaranth)在 Natura 自己的内部命名里是 amaranth,但送进 TE4 的贴图名是 purpleheart,与 Planks.textureNames 的第 8 项对应。

原木组(addWood(log, meta, type),13 条):

输入方块 meta 目标木板名
rareTree 2 purpleheart
bloodwood 0 bloodwood
darkTree 0 darkwood
tree 0 eucalyptus
darkTree 1 fusewood
tree 2 ghostwood
tree 3 hopseed
rareTree 0 maple
redwood 1 redwood
tree 1 sakura
rareTree 1 silverbell
rareTree 3 tiger
willow 0 willow

门组(:85-97)遍历 ((NDoorItem) NContent.doorItem).textureNames,该数组共 7 项(NDoorItem.java:25-26):redwood、eucalyptus、hopseed、sakura、ghostwood、bloodwood、redwoodbark。其中 redwoodbark 在 Planks.textureNames 中不存在,findPlankForName 返回 -1,被 if (plankMeta >= 0) 跳过,因此只发出 6 条门配方。

相关条目