Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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

  • 3 weeks later...

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

width=400 height=82http://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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.