Jump to content

Converting region .mca modded ids to names


Durand1w

Recommended Posts

When you upgrade an existing 1.6.4 world to 1.7.2 (Forge 1065-B65), blocks and items are assigned to the new registry.  However, block and item ids stored in the region .mca files are not converted to block names.  As a result, items can change or disappear if the old value is not assigned to any block or assigned to a different block.

 

Example:

 

a Chest, may be shows as:

id:  Chest

but items inside the chest are shown as

id:  48

id:  9034

 

id:  48 may be a vanilla item and have retained the same id, so it shows correctly.  But item 9034 may be a mod item and it's value is now unassigned and shows as empty, even though the region .mca file still shows that it exists in the chest.

 

I can manually fix this by finding a mod or tool to dump the old ids and dump the new item names, then doing a search and replace of each region.mca for any id:##.  However, if this is a already an existing fix then that would expedite my ability to clear this hurdle to upgrading.  Thank you for any insight.

Link to comment
Share on other sites

For the region .mca files...what is the intended behavior for storing item ids or names?  Should it be the name as with id:Chest or should it be the world specific item(registry) id:##?  I will test here shortly, but if I place a new item in the world or in a storage container, what should I see in regards to the naming behavior? 

 

I can convert the world manually which will be faster than requesting each mod to revisit their 1.7 builds, provided that I can verify that the current behavior for newly placed items in my world is WAI.

Link to comment
Share on other sites

So the 1.6 mods did not have the formatting that the Mapping process anticipated, so it takes a best guess at what is left. 

 

That means, my options are to:

 

1) Ask each individual mod to update 1.6 again

2)  Investigate manually changing the mapping

3)  Manually changing the data to fit the new mappings...which seems like it will be faster and pose less risk to future updates.

 

Any suggestions on a good item id/name dump tool for 1.6 and 1.7 worlds?

Link to comment
Share on other sites

Yeah, I have been using NBTExplorer to track down and fix the 3 mods that renamed their blocks between 1.6/1.7, as well as identifying and fixing a 4th mods crash since one of the values it stores dropped during the 1.6 to 1.7 update process.  It isn't really that bad except tedius given the world size.  Provided I have the IDs/names on 1.6 and the same for 1.7, it's just a matter of search and replace for the items (blocks are fine).....for hours.  I can't save time with find/replace all since some of the id numbers may be contained in other values.  I think Too Many Items provides a dump of the information, I was just hoping to avoid installing another mod if there was an existing command.  Thanks for the information.

Link to comment
Share on other sites

It is possible to edit the mapping smnaully and fix ids. However there isn't anything we can do Forge side beyond what we are already doing.

If mods register there items and blocks correctly Forge updates the map correctly.

Sadly this DOES require a 1.6.4 update to support future compatibility because most modders dont do it.

But you *should* write a tool that edits/builds the ID map manually as it's just a nbt list in the level.dat

 

 

As for the files storing ids or names. they store IDs and a table to translte the IDs to a name.

This is for the simple purpose of 1) Minecraft does it {they dont include the id map cuz well, mojang 2) Storing as IDs allow for better compression. Think of it this way.

"STONE" = 5 bytes

1 = 1 byte

To store 10 indexs that say 'stone'

it would be STONE\x0STONE\x0STONE\x0STONE\x0STONE\x0STONE\x0STONE\x0STONE\x0STONE\x0STONE\x0

Or by ID's it'd be: 1111111111

Much smaller

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Just to confirm.  If I change the nbt list in the level.dat manually, will this cause issues with future updates if new items are added?  I'm not sure what logic Forge uses to assign new ids (sequentially, search algorithm).  I would like to avoid a situation where we are fixing block ids again once we clear the 1.7 upgrade hurdle.

 

Thanks to both of you for the responses today!

Link to comment
Share on other sites

Good deal.

 

It doesn't appear to be a critical issue, but I have already found 15 duplicates out of the first 225 I have audited.  I'm not sure if there is any checks to verify the existence of or remove duplicates, but if you want me to log a ticket on github for it to be looked into at some point, let me know.  The duplicates include Vanilla items.

Link to comment
Share on other sites

I audit and changed every item that was assigned to incorrect values in the level.dats.  I started the world and even though the level.dat has the correct IDs and the region .mca files still show the modded item in chests, etc, none of them appear visibly.  Is there another step that needs to be done?

Link to comment
Share on other sites

I ventured away from my testing area and found that areas that had not loaded showed the items.  I created another test world and implemented the ID fixes before logging into the world.  Everything is as it should be minus 5 items I missed but quickly resolved thanks to our server shop. 

 

This is the last question on this I'll ask now that I have a method to manually get us update.  For the level.dat in the world folder, is it identical (should it be) in any of the dimensions?  We haven't done anything unique between them and by all appearances it looks the same.  If it is, then I can just copy the finished world into the dimension folders to save time later.  Thank you for your help!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.