Posted April 15, 20187 yr Forge 1.12.2 2655 I have neither item nor block textures when they are in the inventory. I have model file, texture file in right places. I register both item and its model in the right order. There are no errors in my console. Debugger tells me that both item and model are registered, and that model can see the .PNG texture. Item class: public class BasicItem extends Item { protected String name; public BasicItem(String name) { this.name = name; setUnlocalizedName(MODID + ":" + name); setRegistryName(name); } } Item manager class: @Mod.EventBusSubscriber public class ItemManager { public static Item ingot_copper = new BasicItem("ingot_copper"); public static List<Item> itemsList = Arrays.asList( ingot_copper ); @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { IForgeRegistry<Item> r = event.getRegistry(); itemsList.forEach(r::register); } public static void registerItemModels() { itemsList.forEach(item -> ModelLoader.setCustomModelResourceLocation( ingot_copper, 0, new ModelResourceLocation(ingot_copper.getRegistryName(), "inventory") )); } } Client proxy class: @Mod.EventBusSubscriber public class ClientProxy extends CommonProxy { @SubscribeEvent public void registerModel(ModelRegistryEvent event) { ItemManager.registerItemModels(); } } assets/<modid>/models/item/ingot_copper.json: { "parent": "item/generated", "textures": { "layer0": "<modid>:items/ingot_copper" } } What am I doing wrong? Edited April 15, 20187 yr by quaiby I'm just very crazy about performance
April 15, 20187 yr 13 minutes ago, quaiby said: @Mod.EventBusSubscriber public class ClientProxy extends CommonProxy { @SubscribeEvent public void registerModel(ModelRegistryEvent event) { ItemManager.registerItemModels(); } } Read the documentation http://mcforge.readthedocs.io/en/latest/events/intro/ 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.
April 15, 20187 yr Author 29 minutes ago, Draco18s said: Read the documentation http://mcforge.readthedocs.io/en/latest/events/intro/ Thank you, that worked I'm just very crazy about performance
April 15, 20187 yr Author 20 minutes ago, diesieben07 said: You cannot have this method here. You cannot access client-only classes (ModelLoader) from common code (ItemManager). By putting a plain @EventBusSubscriber on your client proxy you are also making the server try to load it, this will break. Use thevalue attribute of the @EventBusSubscriber annotation to set the correct side. It works properly on server side. Edited April 15, 20187 yr by quaiby I'm just very crazy about performance
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.