Jump to content

how to make a fluid tank render


memcallen

Recommended Posts

I've made a TileEntity, multiblock tank but I have no idea how to make it render, it currently stores 2000 units (can be adjusted) and it stores it using nbt it the main tank block. I have a separate block to handle the rendering and the variable get transferred correctly. What would be the easiest way to make the handler block render the level?

The proud(ish) developer of Ancients

Link to comment
Share on other sites

Hi

 

Since it's a TileEntity already, I would suggest using a TileEntitySpecialRenderer.  Google should show a few examples, also the vanilla code.

 

In the renderer, assuming the water is a cube, you can use Tessellator commands with a variable height to change the height of the cube

http://greyminecraftcoder.blogspot.com.au/2013/08/the-tessellator.html

 

-TGG

Link to comment
Share on other sites

RenderBlocks.renderBlockLiquid() has something similar to what you want (not in a TESR admittedly)

 

If you read that link I posted you should find it pretty straightforward to change the height of your liquid block.

 

This TESR tutorial is short but will get you started

http://www.minecraftforge.net/wiki/Tile_entity_special_renderer

 

-TGG

 

 

Link to comment
Share on other sites

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.

Announcements



×
×
  • Create New...

Important Information

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