Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Armor enchantments can flip between servers #41

Open
bluelightning32 opened this issue Jun 23, 2019 · 1 comment
Open

Armor enchantments can flip between servers #41

bluelightning32 opened this issue Jun 23, 2019 · 1 comment
Assignees

Comments

@bluelightning32
Copy link

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
@BrainStone
Copy link
Member

Hi there.
First of all I’m glad you managed to fix it in your server. What you did is what I would have suggested. And your analysis of the issue seems correct.

Now the thing is I don’t serialize items by hand. Sponge does that. Even if I did, I’d run into the issue that the way enchantments are serialized currently is the way Minecraft stores them itself. So if I serialize the NBT Data of an item I’d need to convert the enchantment data before storing it (and converting it back).

Don’t get me wrong. I do understand your issue. And I do understand why you are requesting it. Though the issue doesn’t lie within my plugin, but rather with Minecraft itself.

If the enchantment format stays the same in 1.13 and 1.14 I’ll consider trying to add a workaround for it. Since if MC itself changes it in the versions already out, I don’t see a point in adding a complex workaround that’s technically speaking already obsolete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants