Jump to content

How do I revert from using metadata, DataFixers maybe


TheRPGAdventurer

Recommended Posts

I once used metadata for some of my blocks, well i dont like to use them anymore, if I did, we know they are gonna disappear in the world. How do I revert back from using them, what type of unlocalized name strings that I got for my blocks once using metadata should I type in the datafixer. I am asking this because 1.13 removed them, I know its possible because mojang did it to their wool blocks and leaf blocks during "the flattening" of their item.

Link to comment
Share on other sites

1 hour ago, TheRPGAdventurer said:

is there a usage example, do i need to register it correct? where should I use it? In a dataFixer event?

 

The BlockFlattening.create method creates an instance and initialises it with the blocks to be flattened. The instance is registered with the mod's ModFixes instance here, this is called in init.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

1 hour ago, TheRPGAdventurer said:

After this, can i make my own blocks individually now? Like use the manual method of registering them one by one instead of just using getSubType()

 

Yes, but you need to do this before you try to add any remapping.

 

1 hour ago, TheRPGAdventurer said:

As i understad this renames all of them right?

 

Essentially, yes.

 

When it finds your_mod:old_variant_block_with_subtypes in the save, it converts it to the new block based on the metadata:

  • If the metadata corresponds to the variant foobar, it's converted into your_mod:foobar_variant_block
  • If the metadata corresponds to the variant barbaz, it's converted into your_mod:barbaz_variant_block

your_mod:foobar_variant_block and your_mod:barbaz_variant_block would be two separate instances of the same Block class.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.

Announcements



×
×
  • Create New...

Important Information

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