Posted August 12, 20178 yr So ive added a few new fluids, and i have their textures rendering properly in fluid tanks and such, however the acutal fluid in the world, and the icon for the fluid in JEI render as water. Both render as water and im 90% sure its the blockstate.json file. Any help is much appreciated. block_fluids.json Spoiler { "forge-marker": 1, "variants": { "coolant": { "model": "forge:fluid", "custom": { "fluid": "coolant" } }, "energized_redstone": { "model": "forge:fluid", "custom": { "fluid": "energized_redstone" } } } } Edited August 12, 20178 yr by Zeher_Monkey
August 14, 20178 yr Author In my BlockHandlerClass: Spoiler public static void register(){ registerFluidModel(myFluidBlock); } public static void registerFluidModel(TRZBlockFluid fluidBlock){ Item item = Item.getItemFromBlock(fluidBlock); ModelBakery.registerItemVariants(item); final ModelResourceLocation modelResourceLocation = new ModelResourceLocation(OreCraft.mod_id + ":" + "block_fluids", fluidBlock.getFluid().getName()); ModelLoader.setCustomMeshDefinition(item, MeshDefinitionFix.create(stack -> modelResourceLocation)); ModelLoader.setCustomStateMapper((Block) fluidBlock, new StateMapperBase() { @Override protected ModelResourceLocation getModelResourceLocation(IBlockState p_178132_1_) { return modelResourceLocation; } }); } The register() function is called in my CommonProxy preInit() function.
August 14, 20178 yr Author Okay so update, the item tile in the inventory works. I changed some code around to look like this: BlockHandler.java Spoiler public static void register(){ registerFluidBlock(my_fluid_block); registerFluidModel(my_fluid_block); } public static void registerFluidBlock(Block block){ GameRegistry.register(block); } public static void registerFluidModel(TRZBlockFluid fluidBlock){ Item item = Item.getItemFromBlock(fluidBlock); ModelBakery.registerItemVariants(item); final ModelResourceLocation modelResourceLocation = new ModelResourceLocation(OreCraft.mod_id + ":" + "block_fluids", fluidBlock.getFluid().getName()); ModelLoader.setCustomMeshDefinition(item, MeshDefinitionFix.create(stack -> modelResourceLocation)); ModelLoader.setCustomStateMapper((Block) fluidBlock, new StateMapperBase() { @Override protected ModelResourceLocation getModelResourceLocation(IBlockState p_178132_1_) { return modelResourceLocation; } }); GameRegistry.register(item); } However the fluid still renders as water in the world.
August 18, 20178 yr Where do you call BlockHandler.registerFluidModel from? ModelLoader methods need to be called in preInit or ModelRegistryEvent. Model registration must be done in a client-only class. Block and Item registration must be done in common code. You should use the registry events to register your Blocks, Items and other IForgeRegistryEntry implementations. This will make it easier to update to 1.12+, where GameRegistry.register is private. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
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.