2013-06-25 08:53:40 +00:00
|
|
|
package biomesoplenty.blocks.renderers;
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.client.renderer.RenderBlocks;
|
|
|
|
import net.minecraft.world.IBlockAccess;
|
2013-06-30 09:14:10 +00:00
|
|
|
import biomesoplenty.ClientProxy;
|
2013-06-25 08:53:40 +00:00
|
|
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
|
|
|
|
|
|
|
public class PuddleRender implements ISimpleBlockRenderingHandler
|
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
|
|
|
|
{
|
2013-07-01 00:31:34 +00:00
|
|
|
if (modelID == RenderUtils.puddleModel)
|
2013-06-25 08:53:40 +00:00
|
|
|
{
|
|
|
|
RenderUtils.renderStandardInvBlock(renderer, block, metadata);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
|
|
|
|
{
|
2013-07-01 00:31:34 +00:00
|
|
|
if (modelID == RenderUtils.puddleModel)
|
2013-06-25 08:53:40 +00:00
|
|
|
{
|
2013-06-30 09:14:10 +00:00
|
|
|
if (ClientProxy.puddleRenderPass == 0)
|
|
|
|
{
|
|
|
|
renderer.renderStandardBlock(block, x, y, z);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
renderer.setRenderBounds(0.0, 0.8135, 0.0, 1.0, 0.8880, 1.0);
|
2013-06-25 08:53:40 +00:00
|
|
|
|
2013-06-30 09:14:10 +00:00
|
|
|
Block liquidBlock = Block.blocksList[Block.waterStill.blockID];
|
2013-07-01 01:12:33 +00:00
|
|
|
BlockWaterSkinRenderHelper.renderMetadataBlock(liquidBlock, 0, x, y, z, renderer, world);
|
2013-06-30 09:14:10 +00:00
|
|
|
}
|
2013-06-25 08:53:40 +00:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean shouldRender3DInInventory()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getRenderId()
|
|
|
|
{
|
2013-07-01 00:31:34 +00:00
|
|
|
return RenderUtils.puddleModel;
|
2013-06-25 08:53:40 +00:00
|
|
|
}
|
|
|
|
}
|