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

I have added a fluid in 1.8 using the latest build of forge. I have textures and json files, but in game the item in hand has a texture, but the placed fluid is invisible. If you go under it, it has the water material. Also bubbles from water show, but the actual fluid is invisible. I looked through forge's github and IIcons are removed (which I knew), but their are still and flowing icon variables. These are TextureAtlasSprites though and I have no idea how to get my texture to show up using them.

 

tl;dr

I need my Fluid to show up with my texture. Any ideas?

 

Any help is appreciated!

Hi

 

Fluids aren't rendered the same way as normal blocks.  Vanilla does it this way, fluid blocks return 1 for getRenderType().

 

BlockRendererDispatcher::
    public boolean func_175018_a(IBlockState p_175018_1_, BlockPos p_175018_2_, IBlockAccess p_175018_3_, WorldRenderer p_175018_4_)
    {
        try
        {
            int i = p_175018_1_.getBlock().getRenderType();

            if (i == -1)
            {
                return false;
            }
            else
            {
                switch (i)
                {
                    case 1:
                        return this.fluidRenderer.func_178270_a(p_175018_3_, p_175018_1_, p_175018_2_, p_175018_4_);  // here
                    case 2:
                        return false;
                    case 3:
                        IBakedModel ibakedmodel = this.getModelFromBlockState(p_175018_1_, p_175018_3_, p_175018_2_);
                        return this.blockModelRenderer.func_178259_a(p_175018_3_, ibakedmodel, p_175018_1_, p_175018_2_, p_175018_4_);
                    default:
                        return false;
                }
            }
        }

 

Unfortunately I don't know how to get it to show the fluid texture.  You may need to use ASM+Reflection to force a call to your own renderer from this switch.

 

-TGG

 

  • Author

So there is nothing built into forge to be able to render your own fluid? Could I maybe just change the color using hexadecimal (since I just changed the color of the water texture in Photoshop)? I don't need an elaborate or special texture. I just want a fluid that you can see  :P

Forge does have support for fluids but I've never used it so I'm not sure.  Also, I think it may not have been updated for 1.8 yet.

 

If you do figure it out, please let me know, I'd like to do a tutorial / MinecraftByExample topic on it at some point...

 

Cheers

  TGG

 

  • Author

So I have literally coded, deleted, recoded in repeat for the last 2 days updating my mod, yet I still can't figure out this fluid thing. I even created a new TextureMap and TextureAtlasSprite and registered my sprite to a new resource location:

 

public static TextureAtlasSprite[] atlasSpritesFluid = new TextureAtlasSprite[2];
TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
this.atlasSpritesFluid[0] = texturemap.registerSprite(new ResourceLocation("examplemod:textures/blocks/FluidStill.png"));
this.atlasSpritesFluid[1] = texturemap.registerSprite(new ResourceLocation("examplemod:textures/blocks/FluidFlow.png"));

 

I do this because minecraft uses TextureAtlasSprites as the parameters for setStillIcon and setFlowingIcon.

 

But when I setStillIcon and setFlowingIcon to my fluid, it still renders invisible...

 

fluid.setStillIcon(atlasSpritesFluid[0]).setFlowingIcon(atlasSpritesFluid[1]);

 

My fluid does flow and moves seeds and displaces water like any normal fluid, but like stated before, it renders invisible.

 

EDIT: I set a println to tell me the color of the fluid, and even when I set the blocks color, the fluid color stays as 16777215... Any ideas?

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.