方块实体总览
基本信息
| 属性 | 值 |
|---|---|
| TileEntity 总数 | 24 |
| 注册位置 | AlchemicalWizardry.java:1479-1502(24 行连续注册) |
| 注册 API | GameRegistry.registerTileEntity(Class, String unlocalizedName) |
| 所在包 | common.tileEntity(22 个)+ common.demonVillage.tileEntity(2 个) |
24 个 TileEntity 与 39 个方块的对应关系并非一对一:emptySocket 与 bloodSocket 两个方块共用同一个 TESocket(registerTileEntity 对 TESocket 只调用一次)。
继承结构
TileEntity 之间存在 3 层继承,理解它才能看懂本模组的网络同步代码(NewPacketHandler 按基类分组编解码):
| 基类 | 直接子类 | 说明 |
|---|---|---|
TileEntity(Minecraft 原版) |
TEMasterStone、TEHomHeart、TESpectralContainer、TEDemonPortal、TESchematicSaver、TESpectralBlock、TEMimicBlock |
无自定义基类的 7 个 |
TileEntityChest(原版) |
TEDemonChest |
直接继承原版箱子 TE |
TEInventory |
TEAltar、TESocket、TEWritingTable、TEPedestal、TEPlinth、TETeleposer、TECrucible |
带物品栏的 7 个 |
TEOrientable(本身也注册,"containerOrientable") |
TESpellBlock(抽象) |
可朝向容器基类 |
TESpellBlock(抽象) |
TEConduit、TESpellParadigmBlock、TESpellEffectBlock、TESpellModifierBlock、TESpellEnhancementBlock |
5 个法术相关 TE 共用基类 |
TESegmentedReagentHandler |
TEReagentConduit |
试剂分段处理 |
TEReagentConduit |
TEBellJar、TEAlchemicCalcinator |
玻璃钟罩与煅烧炉共用 |
两处值得注意:
TEOrientable既是被注册的 TE(:1488),又是 5 个法术 TE 的抽象基类 ——TESpellBlock extends TEOrientable。因此containerOrientable这个注册名在结构上处于法术 TE 继承链的根部。TEBellJar与TEAlchemicCalcinator共用基类TEReagentConduit(而非各自独立实现),两者都实现IReagentHandler/ISegmentedReagentHandler。
24 个 TileEntity 清单
| # | 类 | 注册名 | 行号 | 主要用途 |
|---|---|---|---|---|
| 1 | TEAltar |
containerAltar |
1479 | 血之祭坛 |
| 2 | TEMasterStone |
containerMasterStone |
1480 | 主仪式石 |
| 3 | TESocket |
containerSocket |
1481 | 血插槽(空/满共用) |
| 4 | TEWritingTable |
containerWritingTable |
1482 | 炼金术台 |
| 5 | TEHomHeart |
containerHomHeart |
1483 | 符咒桌 |
| 6 | TEPedestal |
containerPedestal |
1484 | 奥术基座 |
| 7 | TEPlinth |
containerPlinth |
1485 | 奥术基柱 |
| 8 | TETeleposer |
containerTeleposer |
1486 | 传送器 |
| 9 | TEConduit |
containerConduit |
1487 | 法术管道 |
| 10 | TEOrientable |
containerOrientable |
1488 | 可朝向容器基类 |
| 11 | TESpellParadigmBlock |
containerSpellParadigmBlock |
1489 | 法术基架 |
| 12 | TESpellEffectBlock |
containerSpellEffectBlock |
1490 | 法术效果器 |
| 13 | TESpellModifierBlock |
containerSpellModifierBlock |
1491 | 法术修饰符 |
| 14 | TESpellEnhancementBlock |
containerSpellEnhancementBlock |
1492 | 法术附属 |
| 15 | TESpectralContainer |
spectralContainerTileEntity |
1493 | 光谱容器 |
| 16 | TEDemonPortal |
containerDemonPortal |
1494 | 恶魔传送站 |
| 17 | TESchematicSaver |
containerSchematicSaver |
1495 | 图纸存储器 |
| 18 | TESpectralBlock |
containerSpectralBlock |
1496 | 影桥方块 |
| 19 | TEReagentConduit |
containerReagentConduit |
1497 | 炼金中续器 |
| 20 | TEBellJar |
containerBellJar |
1498 | 玻璃钟罩 |
| 21 | TEAlchemicCalcinator |
containerAlchemicCalcinator |
1499 | 炼金煅烧炉 |
| 22 | TEDemonChest |
containerDemonChest |
1500 | 恶魔的箱子 |
| 23 | TEMimicBlock |
containerMimic |
1501 | 模拟方块 |
| 24 | TECrucible |
containerCrucible |
1502 | 香炉 |
两个恶魔村庄的 TE 位于不同包(AlchemicalWizardry.java:90-91 的 import):
| 类 | 完整包名 |
|---|---|
TEDemonChest |
WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonChest |
TEDemonPortal |
WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal |
其余 22 个均在 WayofTime.alchemicalWizardry.common.tileEntity。
加速器拉黑
TEAltar 与 TEMasterStone 被主动拉黑给两类加速模组(blacklistAccelerators(),AlchemicalWizardry.java:3360-3377):
| 目标模组 | 机制 | 原因标记 |
|---|---|---|
| Torcherino | FMLInterModComms.sendMessage(..., "blacklist-tile", TEAltar.class.getName()) |
— |
| ChromatiCraft | 反射调用 Reika.ChromatiCraft.API.AcceleratorBlacklist.addBlacklist |
BlacklistReason.EXPLOIT |
TEMasterStone 同样被拉黑,说明作者把「血之祭坛」与「主仪式石」都视为可被加速利用的机器。
数值
| 数值名 | 值 |
|---|---|
| TileEntity 总数 | 24 |
位于 common.tileEntity |
22 |
继承自 TEInventory 的 |
7 |
继承自 TESpellBlock 的 |
5 |
直接继承原版 TileEntity 的 |
7 |
位于 common.demonVillage.tileEntity |
2 |
| 被加速器拉黑的 TE | 2 |
| 注册调用是否连续 | 是(:1479-1502 共 24 行) |