Armor CEM Compat
阻止 3D 盔甲资源包破坏所有模组盔甲。
问题所在
你安装了一个 3D 盔甲资源包(CEM),结果发现所有模组盔甲都看起来损坏了——颜色错位、深色斑块,甚至能看到玩家皮肤的孔洞。原版盔甲看起来没问题,但模组盔甲全都不行。
这不仅仅是外观问题:它会阻碍你的整合包。你添加的任何新盔甲层级都会以损坏的状态出现,导致你无法添加进度系统或新维度。
两个让诊断变得困难的细节:
- 物品栏图标看起来是正常的。 错误仅在穿戴时显示(F5)。
- 它还影响僵尸、骷髅、猪灵和盔甲架穿着模组盔甲的情况。
原因分析
*_chestplate.jem 描述的并不是“钻石胸甲”。它描述的是实体的盔甲层——无论该物品来自哪里。因此,它也会捕获模组盔甲。
资源包的纹理是 64x64,但每个模组盔甲使用的是原版的 64x32 布局。UV 被挤压并从错误的位置读取。
而且 EMF 没有过滤这种情况的方法。 它的 items 属性在盔甲层上返回为空。一句话证明:items=none 在你穿戴盔甲时会匹配。
本模组的作用
| # |
问题 |
修复方案 |
| 1 |
盔甲层上的 items= 为空 |
添加了 armor_item 属性,从当前实体读取 getItemBySlot(slot) - 无 NBT,无缓存 |
| 2 |
ETF 仅允许在规则首次匹配时重新评估 |
对 PropertiesRandomProvider.entityCanUpdate() 进行 mixin |
| 3 |
盔甲层保留启动时获得的模型 |
对 HumanoidArmorLayer.getArmorModel() 进行 mixin |
| 4 |
手动编写 48 条规则 |
自带内置资源包,规则已就绪 |
第 3 点本身就很关键: 如果没有这个模组,任何 EMF 盔甲模型变体都不会更新,直到你按下 F3+T。你看到的盔甲是你加入世界时所穿戴的那一个。这会影响所有使用变体的 CEM 盔甲资源包。
安装方法
- 将 jar 文件放入
mods/ 文件夹
- 按原样安装你的 3D 盔甲资源包不要修改它
- 完成
模组附带一个资源包,用于启用自身并置于你的盔甲资源包之上。无需复制或删除任何内容。
需要: EMF 和 ETF —— 即任何 CEM 资源包原本就需要的那些。
如果模组盔甲仍然看起来不正确
在 选项 -> 资源包 中检查兼容资源包是否位于你的盔甲资源包上方,然后重启游戏——仅重载是不够的,因为 EMF 不会实时重建盔甲模型。默认情况下放置位置是正确的。
何时禁用内置资源包
你可以禁用它,模组仍能正常工作(armor_item 属性依然存在)。在以下情况下执行此操作:
- 你的盔甲资源包已自带自己的规则 —— 我们的会覆盖它们
- 你的资源包已使用自己的变体 (
<model>2.jem) —— 它们会发生冲突
- 你想编写自己的规则
armor_item 语法
models.1=2
armor_item.1=chest:minecraft:*_chestplate
armor_item.<n>=<slot>:<id> [更多模式,空格分隔]
slot : head | chest | legs | feet (也支持 helmet/chestplate/leggings/boots)
id : 支持 '*';命名空间默认为 minecraft
'!' : 否定该模式 - 放在 slot 之前
armor_item.1=head:minecraft:*_helmet head:minecraft:turtle_helmet
armor_item.1=!chest:minecraft:*_chestplate
minecraft:*_chestplate 排除任何命名空间的模组 —— 包括后来安装的模组。无需维护列表。
测试环境
Just 3D Armors HMI 1.4 + Advanced Netherite,Fabric 1.21.11,EMF 3.3.5 和 ETF 7.2.1。
原则上适用于其他 CEM 盔甲资源包 —— 文件名由 EMF 定义,而非资源包作者。如果你尝试与其他资源包配合使用,请告诉我结果如何。
致谢
关于调查的完整记录——包括所有尝试过并被排除的方案——见 HALLAZGOS.md。
感谢 Traben 开发 EMF 和 ETF,以及 nagi 开发 Just 3D Armors。
MIT 许可证。使用、修改、打包进你的整合包——无需许可。
Armor CEM Compat
Stop 3D armor resource packs from breaking every modded armor.
The problem
You install a 3D armor resource pack (CEM) and suddenly every modded armor looks destroyed — misplaced colors, dark patches, and holes you can see the player's skin through. Vanilla armor looks fine. Modded armor doesn't. All of it.
And it's not just cosmetic: it blocks your modpack. Any new armor tier you add comes in broken, so you can't add progression or new dimensions.
Two details that make it hard to diagnose:
- The inventory icon looks fine. The bug only shows on worn armor (F5).
- It also affects zombies, skeletons, piglins and armor stands wearing modded armor.
Why it happens
A *_chestplate.jem doesn't describe "the diamond chestplate". It describes the entity's armor layer — whatever item it comes from. So it captures modded armor too.
The pack's textures are 64x64, but every modded armor uses the vanilla 64x32 layout. The UVs get squeezed and read from the wrong place.
And EMF had no way to filter that. Its items property comes back empty on armor layers. One-line proof: items=none matches while you're wearing armor.
What this mod does
| # |
Problem |
Fix |
| 1 |
items= is empty on armor layers |
adds the armor_item property, reading getItemBySlot(slot) from the live entity - no NBT, no caching |
| 2 |
ETF only allows re-evaluation the first time a rule matches |
mixin on PropertiesRandomProvider.entityCanUpdate() |
| 3 |
The armor layer keeps the model it got at startup |
mixin on HumanoidArmorLayer.getArmorModel() |
| 4 |
Writing 48 rules by hand |
ships a built-in resource pack with them ready |
Point 3 matters on its own: without this mod, any EMF armor model variant won't update until you press F3+T. The armor you see is whichever you were wearing when you joined the world. That affects every CEM armor pack using variants.
Installation
- Drop the jar into your
mods/ folder
- Install your 3D armor pack as-is - don't modify it
- That's it
The mod ships a resource pack that enables itself and sits above your armor pack. Nothing to copy or move.
Requires: EMF and ETF - the same ones any CEM pack already needs.
If modded armor still looks wrong
Check in Options -> Resource Packs that the compat pack is above your armor pack, then restart the game - reloading isn't enough, because EMF doesn't rebuild armor models on the fly. It's placed correctly by default.
When to disable the built-in pack
You can disable it and the mod still works (the armor_item property stays). Do it if:
- Your armor pack already ships its own rules - ours would override them
- Your pack already uses its own variants (
<model>2.jem) - they'd collide
- You want to write your own rules
armor_item syntax
models.1=2
armor_item.1=chest:minecraft:*_chestplate
armor_item.<n>=<slot>:<id> [more patterns, space separated]
slot : head | chest | legs | feet (also helmet/chestplate/leggings/boots)
id : supports '*'; namespace defaults to minecraft
'!' : negates the pattern - goes BEFORE the slot
armor_item.1=head:minecraft:*_helmet head:minecraft:turtle_helmet
armor_item.1=!chest:minecraft:*_chestplate
minecraft:*_chestplate excludes any mod by namespace - including ones installed later. No list to maintain.
Tested with
Just 3D Armors HMI 1.4 + Advanced Netherite, on Fabric 1.21.11 with EMF 3.3.5 and ETF 7.2.1.
Works with other CEM armor packs in principle - the file names are defined by EMF, not by the pack author. If you try it with another pack, please let me know how it went.
Credits
Full write-up of the investigation - including everything that was tried and ruled out - is in HALLAZGOS.md.
Thanks to Traben for EMF and ETF, and to nagi for Just 3D Armors.
Licensed MIT. Use it, modify it, bundle it in your modpack - no permission needed.
评论 0
登录后参与评分
还没有评论,来抢沙发吧