Posted October 20, 20169 yr I'm using a method inside my Item class to register the ItemRenderer by calling ModClass.proxy.registerItemRenderer(this); This method is empty on CommonProxy obviously but on ClientProxy it calls ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); Since the method inside my Item class is called just after registering the item, it is from preInit. Should I do it differently? Should I do it the same way but on init or postInit? Thanks in advance.
October 20, 20169 yr I'm using a method inside my Item class to register the ItemRenderer by calling ModClass.proxy.registerItemRenderer(this); This method is empty on CommonProxy obviously but on ClientProxy it calls ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); Since the method inside my Item class is called just after registering the item, it is from preInit. Should I do it differently? Should I do it the same way but on init or postInit? Thanks in advance. In preInit after registration or before? I dont think it matters. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
October 20, 20169 yr Author I'm using a method inside my Item class to register the ItemRenderer by calling ModClass.proxy.registerItemRenderer(this); This method is empty on CommonProxy obviously but on ClientProxy it calls ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); Since the method inside my Item class is called just after registering the item, it is from preInit. Should I do it differently? Should I do it the same way but on init or postInit? Thanks in advance. In preInit after registration or before? I dont think it matters. Thanks. I was worried since I saw some codes where they call a static method that registers all the renderers together in Initialization
October 20, 20169 yr The difference is between using ModelLoader.setModelResourceLocation(item, meta, location) and Minecraft::register(item, meta, location). The prior will get called in preInit and the later after preInit. The later is also really finicky about what happens before/after so stick with ModelLoader version. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
October 20, 20169 yr Author The difference is between using ModelLoader.setModelResourceLocation(item, meta, location) and Minecraft::register(item, meta, location). The prior will get called in preInit and the later after preInit. The later is also really finicky about what happens before/after so stick with ModelLoader version. Very useful. Thanks!
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.