Posted February 6, 201510 yr Trying to make a custom liquid, and when I instantiate the BlockLiquid I get an "InvalidMaterial" error... This happens every time I place the liquid from my custom item bucket class. Whats happening is this: I have my Custom Liquid/Fluid class that is constructed using a custom material: public class BlockFluidCustom extends BlockLiquid { public static final String name = "fluid_snow"; public BlockFluidCustom() { super(Mod.customMaterial); } } And whenever I try to place the custom liquid, this method gets invoked... public static BlockDynamicLiquid getFlowingBlock(Material materialIn) { if (materialIn == Material.water) { return Blocks.flowing_water; } else if (materialIn == Material.lava) { return Blocks.flowing_lava; } else { throw new IllegalArgumentException("Invalid material"); } } THUS, the error is thrown. http://minecraftforge.net/forum/Smileys/default/cry.gif Stacktrace: java.lang.IllegalArgumentException: Invalid material at net.minecraft.block.BlockLiquid.getFlowingBlock(BlockLiquid.java:383) at net.minecraft.block.BlockLiquid.getFlowDirection(BlockLiquid.java:292) at net.minecraft.client.renderer.BlockFluidRenderer.renderFluid(BlockFluidRenderer.java:82) at net.minecraft.client.renderer.BlockRendererDispatcher.renderBlock(BlockRendererDispatcher.java:72) at net.minecraft.client.renderer.chunk.RenderChunk.rebuildChunk(RenderChunk.java:178) at net.minecraft.client.renderer.chunk.ChunkRenderWorker.processTask(ChunkRenderWorker.java:100) at net.minecraft.client.renderer.chunk.ChunkRenderDispatcher.updateChunkNow(ChunkRenderDispatcher.java:144) at net.minecraft.client.renderer.RenderGlobal.setupTerrain(RenderGlobal.java:882) at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1264) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1207) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1032) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1048) at net.minecraft.client.Minecraft.run(Minecraft.java:345) at net.minecraft.client.main.Main.main(Main.java:117) Is there a way around this?!? Could I just change the texture of the fluid, but construct it with Material.water? heeeelllp plis. I may have over-thunk it...
February 6, 201510 yr Author Posted by: diesieben07 « on: Today at 12:50:34 AM » Insert Quote Don't use the vanilla liquid blocks. Use Forge's BlockFluidClassic. Forgot to mention: I tried BlockFluidClassic and I couldn't figure out how to put the texture on the block. Every time I placed it minecraft crashed, giving me a NullPointer..Something about Texture Atlas and a setIcons() method... How would I Implement that method in the liquid classes I have? It that what you are talking about? I may have over-thunk it...
February 21, 201510 yr I'd have to see the rest of the block's code, because honestly the only trouble I'm having is with registering the fluid. The texturing is done within the blockstate file now and you have to make sure you define TRANSLUCENT as well as a few other rendering methods. a.k.a. Sirius http://i.imgur.com/QRtYi6e.png[/img]
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.