Firestone(余烬石)效果
[!WARNING] 已订正(1.7.10 树) 原条目多处取自
mc-1.12.2:
FirestoneTools.java类在 1.7.10 中不存在, 原条目引用的FirestoneTools.createEntity(...)/trySpawnFire(...)无对应实现。ItemFirestone.java不存在——1.7.10 的基类是ItemFirestoneBase(抽象类)。- 原条目的方法签名用 1.12.2 的
BlockPos/@Nullable, 而 1.7.10 源码中BlockPos零命中,对应签名为(World, int x, int y, int z)。createEntity()实际创建的是EntityItemFireproof, 不是EntityItemFirestone。证据:
firestone/ItemFirestoneBase.java:21-66、firestone/EntityItemFirestone.java:25-28、firestone/FirestoneTickHandler.java:31-90。
基本信息
| 属性 | 值 |
|---|---|
| 基类 | ItemFirestoneBase(抽象类,extends ItemRailcraft) |
| 1.7.10 中的具体子类 | ItemFirestoneRaw、ItemFirestoneCracked、ItemFirestoneCut、ItemFirestoneRefined |
ItemFirestone.java |
不存在 |
FirestoneTools.java |
不存在 |
| 可修复 | 否(isRepairable() 恒返回 false,ItemFirestoneBase.java:64-66) |
| 自定义实体 | 恒为 true(hasCustomEntity(),ItemFirestoneBase.java:34-36) |
注册名
各子类均为独立注册名(点号式,firestone/ 下 4 个类的 String tag):
| 子类 | 注册名 |
|---|---|
ItemFirestoneRaw |
railcraft.firestone.raw |
ItemFirestoneCracked |
railcraft.firestone.cracked |
ItemFirestoneCut |
railcraft.firestone.cut |
ItemFirestoneRefined |
railcraft.firestone.refined |
原条目写的
railcraft:firestone(无变体)是错的——1.7.10 没有名为firestone的单一物品。
自定义掉落物实体(createEntity(),ItemFirestoneBase.java:50-59)
@Override
public Entity createEntity(World world, Entity location, ItemStack stack) {
EntityItemFireproof entity = new EntityItemFireproof(world, location.posX, location.posY, location.posZ, stack);
entity.motionX = location.motionX;
entity.motionY = location.motionY;
entity.motionZ = location.motionZ;
entity.delayBeforeCanPickup = 10; // 10 tick 拾取延迟
return entity;
}
| 属性 | 值 |
|---|---|
| 实际创建类 | EntityItemFireproof |
| 拾取延迟 | delayBeforeCanPickup = 10 tick |
| 动量 | 继承原 EntityItem 的 motionX/Y/Z |
EntityItemFirestone(另一个独立注册实体)
EntityItemFirestone extends EntityItemFireproof(EntityItemFirestone.java:25),
作为实体单独注册:
EntityRegistry.registerModEntity(EntityItemFirestone.class, "ItemFirestone",
EntityIDs.ENTITY_ITEM_FIRESTONE, Railcraft.getMod(), 64, 20, true);
| 属性 | 值 |
|---|---|
| 实体注册名 | ItemFirestone(EntityIDs.ENTITY_ITEM_FIRESTONE = 75) |
| 跟踪范围 | 64 |
| 更新频率 | 20 |
| 是否发送 | true |
EntityItemFireproof.java文件不在firestone/目录, 而是common/items/EntityItemFireproof.java(实体 IDENTITY_ITEM_FIREPROOF = 76)。
生火逻辑(FirestoneTickHandler,非 FirestoneTools)
真正的火焰生成逻辑在 FirestoneTickHandler(firestone/FirestoneTickHandler.java),
不是原条目写的 FirestoneTools:
| 方法 | 位置 | 说明 |
|---|---|---|
spawnFire(EntityPlayer player) |
:64-78 |
在玩家位置尝试生火,成功时置 spawnedFire |
canBurn(World world, int x, int y, int z) |
:80-… |
判断该位置能否燃烧 |
| 主循环 | :56 |
`spawnedFire |
canBurn()的具体判定方块列表本次未逐行核实, 原条目列出的「木头 / 羊毛 / 树叶 / 草类 / 藤蔓」在 1.7.10 中无法确认,故不照抄。
1.7.10 中不存在的机制
| 原条目声称 | 1.7.10 实际情况 |
|---|---|
FirestoneTools.createEntity(...) |
无此类;由 ItemFirestoneBase.createEntity() 直接构造 EntityItemFireproof |
FirestoneTools.trySpawnFire(World, BlockPos, ItemStack, EntityPlayer) |
无此类;生火在 FirestoneTickHandler |
FirestoneTools.canBurn / spawnFire |
无此类 |
createEntity 返回 EntityItemFirestone |
返回 EntityItemFireproof |
| 可修复:否 | 正确(isRepairable() 恒 false) |
相关条目
- Refined Firestone 效果 - 精炼余烬石的具体效果
- Firestones