Trying to tetrize a tool with duplicate enchants will crash the game
Alexandqr opened this issue ยท 1 comments
Observed behaviour
This bug will (almost) never happen in vanilla, however if you try to tetrize a tool that has 2 same enchants, the game will crash.
Expected behaviour
The easiest way to fix the crash would just be to ignore one of the duplicates, which is the case for any enchantments that tetra doesn't recognize as fit for the tool/weapon that were pre-applied before being put in the table.
Steps to reproduce
- Open a world
- Give yourself an item that has 2 of the same enchant (like Sharp 3 + Sharp 2). You can do this by typing: /give @p wooden_sword{Enchantments:[{id:sharpness,lvl:3},{id:sharpness,lvl:2}]} 1
- Try to put it in a tetra table
- Watch your minecraft perish as you receive error code: java.lang.IllegalStateException: Duplicate key net.minecraft.world.item.enchantment.DamageEnchantment@4f56bec2 (attempted merging values 3 and 2)
Crashlog
No response
Tetra version
4.9.3
mutil/mGui version
4.5.0
Forge version
1.18.2 - 40.1.51
Other mods
No response