Jump to content

[1.8] Custom Liquid not working... :(


Eetmorchikn

Recommended Posts

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...

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

  • 3 weeks later...

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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