Armor enchantments can flip between servers
Created by: bluelightning32
Issue Description:
I added another minecraft instance running the same modpack. Players complained that when the logged into the new instance, the enchantments changed on their armor.
They gave a specific example of obsidian boots that originally had a multijump IV enchantment, but it synced as beheading IV on the new server.
I was able to reproduce it. This is the json for the boots:
{"stack":{"ContentVersion":1,"ItemType":"mekanismtools:obsidianboots","UnsafeDamage":0,"Count":1,"UnsafeData":{"ench":[{"lvl":4,"id":105}],"RepairCost":1,"ForgeCaps":{"astralsorcery:cap_item_amulet_holder":{"AS_Amulet_HolderLeast":-6587230391593753591,"AS_Amulet_HolderMost":3320807983800733515}}}}
I discovered that the enchantment ids are mapped to enchantments in the level.dat file, under FML/Registries/minecraft:enchantments/ids. Enchantment id 105 was mapped to different things on the two servers. The original server has been through many modpack upgrades, and I suspect that's why it had a different enchantment id mapping.
I worked around this by copying the enchantment id mapping from level.dat on the source server to the target server. This will fix it for player inventory, but now the enchantments will be wrong on loot they get from dungeons (because I already pregenned the world).
Ideally invsync would serialize the enchantment ids as enchantment names.
Affected Versions (Do not use "latest"):
- Minecraft: 1.11.2
- InvSync: InvSync-0.6.19.311-DEV.jar
- Sponge: aaaa-spongeforge-1.12.2-2825-7.1.6.jar
- Other related mods: Modpack DD&SS 5.2