Jump to content

Recommended Posts

Posted (edited)

I am currently rewriting a mod previously written for 1.12 in version 1.15. The mod encouraged giant builds, and I'd really like for the mod to be able to be converted from the old version to the new one. I went onto the discord server and asked how to achieve this and concluded that I was going to use an event to tell the game which old registry name should be matched with which new block (for instance). I therefore tried subscribing to RegistryEvent.MissingMappings in the following way:

 

@EventBusSubscriber(modid = SCPLockdown.MOD_ID, bus = EventBusSubscriber.Bus.FORGE)
public class CommonForgeEvents
{
    @SubscribeEvent
    public static void fixBlockMappings(RegistryEvent.MissingMappings<Block> event)
    {
        System.out.println("Start of blockmappings");
        for(RegistryEvent.MissingMappings.Mapping<Block> blockMapping : event.getMappings())
        {
            System.out.println(blockMapping.id);
        }
    }
}

This method does not print at all when I try and convert an old 1.12 world in the 1.15 version, even if I used the MOD bus instead of the FORGE bus. I therefore came to the conclusion that it doesn't fire at all, and I cannot test with it right now.

 

I also tried matching the registry name from the old version with the new one. This did not work - all of the mods blocks were removed upon convertion, even if the names matched.

Edited by That_Martin_Guy
Posted (edited)
14 hours ago, That_Martin_Guy said:

even if I used the MOD bus instead of the FORGE bus.

RegistryEvents are fired at MOD bus.

Check if your class gets loaded at all. To ensure it happens, you may create black method and invoke it from your mod initializer. Read sign.

Edited by Dzuchun

Everything said above may be absolutely wrong. No rights reserved.

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.