TileMachine
基本信息
| 属性 | 值 |
|---|---|
| 类名 | pl.asie.lib.tile.TileMachine |
| 类型 | class extends TileEntityBase,实现 IConnectable, ISidedInventory |
| 方法数 | 47(库内最多) |
| 源码规模 | 496 行 |
| 启用版本 | 1.7.10 |
功能
asie 机器 TileEntity 的通用基类:把库存、侧面IO、能量、连接性与
IBattery / IRedstoneProvider / IInformationProvider 等接口接在一起,
让具体机器只需实现少量钩子。
实现要点
- ⚠️
TileMachine.java:488-493里isGivingInformation()与getInfoData()两个 GregTech@Optional.Method适配方法整段被注释掉,因此它们不在类中;IInformationProvider的实现靠本类自己的同名方法。 - 类注释里以
/* RedLogic */标注的接口依赖是软的(ISidedInventory的 RedLogic 变体)。 - 47 个方法覆盖
IInventory全套(getSizeInventory/getStackInSlot/setInventorySlotContents…)与IEnergyHandler转发。 - 本 mod 不注册任何它的实例;它供 asie 的内容 mod 继承。
相关条目
- TileEntityBase - 父类
- TileEntityInventory - 更轻量的库存版基类
- IBattery - 电量契约
- IInformationProvider - 调试信息契约
- BatteryBasic - 配套的电池实现
- BlockBase - 配套的方块基类