![Curios API Continuation [Frozen]](https://media.forgecdn.net/avatars/thumbnails/1017/129/256/256/638543265839292912_animated.gif)
[Bug]: 1.21.1 Crash when equipping two of the same Iron’s Spells ‘n Spellbooks curio
pyrige opened this issue · 2 comments
Minecraft Version
1.20.6
What happened?
When equipping a second of an already equipped curio from Iron's Spells 'n Spellbooks. Test with Ring of Recovery and Ring of Expediency.
Also tried with Adorned, which didn't exhibit the issue.
Mod List:
irons_spellbooks-1.21-3.4.4-all.jar |Iron's Spells 'n Spellbooks |irons_spellbooks |1.21-3.4.4 |Manifest: NOSIGNATURE
client-1.21.1-20240808.144430-srg.jar |Minecraft |minecraft |1.21.1 |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f
caelus-neoforge-7.0.0+1.21.jar |Caelus API |caelus |7.0.0+1.21 |Manifest: NOSIGNATURE
curios-neoforge-9.0.6+1.21.jar |Curios API |curios |9.0.6+1.21 |Manifest: NOSIGNATURE
geckolib-neoforge-1.21-4.5.8.jar |GeckoLib 4 |geckolib |4.5.8 |Manifest: NOSIGNATURE
player-animation-lib-forge-1.0.2-rc1+1.21.jar |Player Animator |playeranimator |1.0.2-rc1+1.21 |Manifest: NOSIGNATURE
neoforge-21.1.19-universal.jar |NeoForge |neoforge |21.1.19 |Manifest: NOSIGNATURE
How do you trigger this bug?
- Equip Ring of Expediency in first ring curio slot.
- Equip another Ring of Expediency in second ring curio slot.
Loader
NeoForge
Loader Version
21.1.19
Mod Version
9.0.6+1.21.1
Relevant Log Outputs
Hi. After a quick review, I found out the following:
- The problem is observed because Iron's Spells 'n Spellbooks creates an attribute with the same id for its rings. Since the attribute system was redesigned in Minecraft 1.21, attribute processing now requires more work than on previous versions of the game. Example of mine implementation: https://github.com/SSKirillSS/relics/blob/1.21.0/src/main/java/it/hurts/sskirillss/relics/items/relics/base/RelicItem.java#L44-L48
- The problem does not occur in Adorned, because Adorned simply chooses not to apply this attribute to the player. For example, if you have 2 rings that each give +10% to movement speed, equipping 2 of those rings in Adorned will only give you +10% instead of +20% and no error will occur. In the case of CuriosAPI Continuation, there will be a crash that will tell you that the attributes are not being handled correctly.