BiomesOPlenty/common/biomesoplenty/blocks/renderers/PuddleRender.java

52 lines
1.3 KiB
Java
Raw Normal View History

package biomesoplenty.blocks.renderers;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import biomesoplenty.ClientProxy;
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)
{
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)
{
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);
Block liquidBlock = Block.blocksList[Block.waterStill.blockID];
BlockWaterSkinRenderHelper.renderMetadataBlock(liquidBlock, 0, x, y, z, renderer, world);
}
}
return true;
}
@Override
public boolean shouldRender3DInInventory()
{
return true;
}
@Override
public int getRenderId()
{
2013-07-01 00:31:34 +00:00
return RenderUtils.puddleModel;
}
}