Posted June 1, 20196 yr Hi. I have got an issue with a custom fluid block, that I have been trying to fix for a whole night. The issue is that I am not able to get my custom fluid texture to render. The Forge bucket texture works, but the actual block texture doesn't. No matter what I do I always get one of these results: The block is not rendered at all (there you can see through, but the block is obviously here as it still affects entities, make particles, etc...) The block is rendered as the missing model placeholder The block is rendered as a vanilla fluid My code: ModFluids.java - Here I initialize the Fluid https://pastebin.com/sxUHCSXc The fluid is registered from a static block in my main class: static { FluidRegistry.enableUniversalBucket(); FluidRegistry.registerFluid(ModFluids.GASOLINE); FluidRegistry.addBucketForFluid(ModFluids.GASOLINE); } BlockGasoline.java - The block that uses the Fluid https://pastebin.com/eVDV90vr The block is initialized like this: public static final Block GASOLINE = new BlockGasoline(ModFluids.GASOLINE,Material.WATER).setRegistryName("gasoline").setUnlocalizedName("gasoline"); And registered using RegistryEvent.Register<Block> @SubscribeEvent public static void registerBlocks(final RegistryEvent.Register<Block> event) { final IForgeRegistry<Block> registry = event.getRegistry(); for (Block block : SevenDaysToMine.BLOCKS) { registry.register(block); } } And this is how I register the models @SubscribeEvent @SideOnly(Side.CLIENT) public static void onModelEvent(final ModelRegistryEvent event) { for (Block block : SevenDaysToMine.BLOCKS) { registerBlockModel(block); } registerItemBlockModels(); registerItemModels(); } @SideOnly(Side.CLIENT) public static void registerBlockModel(Block block) { if (block instanceof IBlockBase) { IBlockBase iblockbase = (IBlockBase) block; if (iblockbase.hasCustomStateMapper()) { if (iblockbase.getStateMapper() != null) { ModelLoader.setCustomStateMapper(block, iblockbase.getStateMapper()); return; } else { Utils.getLogger().warn("Trying to add a null IStateMapper to " + block.getRegistryName() + " . That is a bad thing!"); } } } registerBlockModel(block, 0); } The .json blockstate file is correctly located in the blockstates folder and looks like this: { "forge_marker": 1, "variants": { "fluid": { "model": "forge:fluid", "custom": { "fluid": "gasoline" } }, "inventory": { "model": "forge:forgebucket", "transform": "forge:default-item", "custom": { "fluid": "gasoline" } } } } If I change in the file "gasoline" to some random word, it renders the vanilla water texture (which I suppose is a placeholder), however, if I change it to "lava", it correctly renders vanilla lava. EDIT: Solved, caused by Fluid#setColor() Edited June 2, 20196 yr by Nuparu00 Solved
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.