村庄铁匠铺战利品 Village Blacksmith Loot

向原版村庄铁匠铺的箱子注入 神秘道具 meta 0(bucketHoley)——这是该变体的唯一来源。

  • 注册:mobheads/IguanaMobHeads.postInit(不是 IguanaWorldGen)
  • 注入代码:
ChestGenHooks.addItem(ChestGenHooks.VILLAGE_BLACKSMITH,
        new WeightedRandomChestContent(new ItemStack(wearables, 1, 0), 0, 1, 1));
  • 模块:MobHeads
  • 执行时机:FMLPostInitializationEvent

参数解读

参数 值 含义
物品 wearableBucket meta 0 变体名 bucketHoley,贴图 textures/models/bucket_helmet.png
数量范围 0, 1 0 或 1 个
权重 1 标准权重

这是本 mod 第 7 个被注入战利品的结构

除本条外,全部 8 条战利品注入如下:

# 结构 注入模块 内容 权重
1 村庄铁匠铺(本页) MobHeads 神秘道具 meta 0 1
2 要塞图书馆 MobHeads 神秘道具 meta 3 1
3~8 奖励箱、地牢箱、废弃矿井、沙漠金字塔、丛林神庙、要塞图书馆 WorldGen RandomWeaponChestContent 武器 2 或 10

其中 要塞图书馆 被两个模块各注入一次,共 2 条战利品条目。

RandomWeaponChestContent 之外的注入

worldgen/RandomWeaponChestContent 是 WorldGen 模块唯一的注入类型(6 条,全部是它)。铁匠铺的这条注入与武器战利品完全无关——它直接使用 Forge 的 WeightedRandomChestContent(Forge 原生类)而非本 mod 的自定义类。

源码注释就一个 // :>,暗示这是作者刻意加入的「彩蛋」式掉落。

设计意图

铁匠铺是最早期可达的村庄建筑,因此放置了这个「桶头盔」道具——Wearable 类本身在源码中被注释为 // secret thing 与 // psssssst!,属于刻意隐藏的彩蛋道具。

4 个 神秘道具 变体的完整来源:

meta 变体 贴图 来源
0 bucketHoley textures/models/bucket_helmet.png 村庄铁匠铺(本页)
1 clayBucketCracked textures/items/clayBucketCracked.png 黏土岩浆桶 销毁时 1/1000
2 endermanJaw textures/items/endermanJaw.png 击杀末影人时 1/1000
3 bathat (无贴图文件) 要塞图书馆

NEI 隐藏

mobheads/proxy/MobHeadClientProxy 会在装了 NEI 时把全部 4 个变体从 NEI 中隐藏:

API.hideItem(new ItemStack(IguanaMobHeads.wearables, 1, 0));  // ... 1);  // ... 2);  // ... 3);

即这 4 个道具在 NEI 中不可见,只能靠上述三条途径获得——这解释了源码中 // secret thing 的注释。

相关