Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/12/19 in all areas

  1. Problematic Code #1, Code Style #1, #2, #3, #4 Your chests aren't instances of IHasModel, so their Item models aren't being registered. (It's almost like IHasModel is useless because all Blocks and Items need models!) Even if they were, you've commented out the registerModels code in the copper chest anyways, which probably wouldn't help matters. Edit: You'll also have a rather brown-looking iron chest, since you just copied the copper chest's Json over to the iron one.
    2 points
  2. Do not make your classes implement IHasBlockModel.Refer here. (Code-Style, #3) Register your items/blocks like this instead. @SubscribeEvent public static void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll(ModBlocks.BLOCKS); Utils.getLogger().info("Blocks Registered"); } @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(ModItems.ITEMS); for (Block block : ModBlocks.BLOCKS) { event.getRegistry().register(new ItemBlock(block).setRegistryName(block.getRegistryName()).setUnlocalizedName(block.getUnlocalizedName())); } Utils.getLogger().info("Items Registered"); } @SubscribeEvent public static void registerModels(ModelRegistryEvent event) { for (Block block : ModBlocks.BLOCKS) { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); } for (Item item : ModItems.ITEMS) { ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } Utils.getLogger().info("Models Registered"); }
    1 point
  3. For entities you need your own obj model loader/renderer. For items/blocks you need to put your model and material(.obj and .mtl files) in an appropriate models subfolder in your assets, point to that model through a blockstates file for example(if you are using forge's blockstates for items) and you are done. There are a few thing you need to know: 1. When specifying an obj model to be used you must include the obj extension in the path too. 2. You must call OBJLoader.INSTANCE.addDomain(modid) with your modid as a parameter before the models are loaded. Here(and the resources folder) is an example provided by forge itself.
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.