I'm done writing the code to add a new item which as far as I'm concerned should be correct, but I'm still getting errors in few class files. The errors as far as I know are for things that are included with forge, so I'm not sure how to fix them.
1. The preInit from the following code is underlined and gives this message: "The method preInit(FMLPreInitializationEvent) is undefined for the type CommonProxy". The same error is in the init and postInit variants as well. There are no errors in the CommonProxy class file either, but I can add it if it's needed.
@EventHandler
public static void preInit(FMLPreInitializationEvent event) {
proxy.preInit(event);
}
2. The getRegistry() gives the following error "The method getRegistry() is undefined for the type RegistryEvent<Item>".
@SubscribeEvent
public static void onItemRegister(RegistryEvent<Item> event) {
event.getRegistry().registerAll(ItemInit.ITEMS.toArray(new Item[0]));
}
3. The getRegistryName() gives the following error "The method getReristryName() is undefined for the type ClientProxy".
@Override
public void registerItemRenderer(Item item, int meta, String id) {
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item, getReristryName(), id));
}
I'm not sure how common there kinds of errors are, so I'm not sure how much information is needed. Let me know if you need more information on something.