Posted July 19, 20205 yr Hello, I have recently seen Deferred Registering in the docs so I went I read about how its the new way of registering stuff so I switch my registering to this. But whenever I try to use it it give me a warning - The constructor DeferredRegister<Block>(IForgeRegistry<Block>, String) is deprecated And this is all the code I wrote: import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class ModEventSubsciber { private static final DeferredRegister<Block> BLOCKS = new DeferredRegister<Block>(ForgeRegistries.BLOCKS, null); public static final RegistryObject<Block> ROCK_BLOCK = BLOCKS.register("rock", () -> new Block(Block.Properties.create(Material.ROCK))); public ModEventSubsciber() { BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus()); } } Thank you for reading!!!
July 19, 20205 yr Look at the javadoc. Its super blatantly obvious what you should do. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
July 19, 20205 yr Author I looked at the Javadocs it still says that its deprecated when I follow it. Javadocs: private static final DeferredRegister BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS, MODID); My code: private static final DeferredRegister BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS, Main.MODID);
July 19, 20205 yr Jesus christ. https://github.com/MinecraftForge/MinecraftForge/blob/1.15.x/src/main/java/net/minecraftforge/registries/DeferredRegister.java#L93 Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.