BiomesOPlenty/common/biomesoplenty/blocks/BlockPuddle.java

110 lines
2.5 KiB
Java
Raw Normal View History

package biomesoplenty.blocks;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
2013-06-30 22:12:37 +00:00
import biomesoplenty.ClientProxy;
2013-07-01 00:31:34 +00:00
import biomesoplenty.blocks.renderers.RenderUtils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPuddle extends Block
{
@SideOnly(Side.CLIENT)
private Icon field_94441_a;
@SideOnly(Side.CLIENT)
private Icon field_94440_b;
public BlockPuddle(int par1)
{
super(par1, Material.ground);
this.setTickRandomly(true);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8135F, 1.0F);
this.setLightOpacity(0);
}
2013-07-01 00:31:34 +00:00
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
return AxisAlignedBB.getAABBPool().getAABB((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 0), (double)(par2 + 1), (double)(par3 + 0.8135F), (double)(par4 + 1));
}
2013-07-01 00:31:34 +00:00
@Override
public boolean isBlockNormalCube(World world, int x, int y, int z)
{
return false;
}
2013-07-01 00:31:34 +00:00
@Override
public boolean isOpaqueCube()
{
return false;
}
2013-07-01 00:31:34 +00:00
@Override
public boolean renderAsNormalBlock()
{
return false;
}
2013-07-01 00:31:34 +00:00
@Override
public void updateTick(World world, int x, int y, int z, Random par5Random)
{
2013-08-07 02:03:47 +00:00
if (!world.isRaining() && world.rand.nextInt(2) == 0)
{
world.setBlock(x, y, z, Block.dirt.blockID);
}
}
@Override
public int getRenderBlockPass()
{
return 1;
}
@Override
public boolean canRenderInPass(int pass)
{
ClientProxy.puddleRenderPass = pass;
return true;
}
@Override
public int getRenderType()
{
2013-07-01 00:31:34 +00:00
return RenderUtils.puddleModel;
}
2013-07-01 00:31:34 +00:00
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2)
{
return Block.dirt.getBlockTextureFromSide(par1);
}
2013-07-01 00:31:34 +00:00
@Override
public int idDropped(int par1, Random par2Random, int par3)
{
return Block.dirt.idDropped(0, par2Random, par3);
}
2013-07-01 00:31:34 +00:00
@Override
@SideOnly(Side.CLIENT)
public int idPicked(World par1World, int par2, int par3, int par4)
{
return Block.dirt.blockID;
}
2013-07-01 00:31:34 +00:00
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister)
{
}
}