That_Martin_Guy Posted August 2, 2020 Posted August 2, 2020 (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 August 2, 2020 by That_Martin_Guy Quote
Dzuchun Posted August 2, 2020 Posted August 2, 2020 (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 August 2, 2020 by Dzuchun Quote Everything said above may be absolutely wrong. No rights reserved.
Recommended Posts
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.