resonant-induction/minecraft/liquidmechanics/common/block/BlockPipe.java
Rseifert b9833f6327 more changes of the last
Still working on moving everything over to my new system. So far i've
got it mostly done for the tank and pipe though i have no way to test
them yet.

I would list the change but meh its break time, i'm tired and the code
says everything

Things that are still broken
*Lang file
*release Valve
*pipe
*Tank
*Some crafting
2013-01-05 15:05:53 -05:00

85 lines
2.3 KiB
Java

package liquidmechanics.common.block;
import java.util.Random;
import universalelectricity.prefab.BlockMachine;
import liquidmechanics.client.render.BlockRenderHelper;
import liquidmechanics.common.LiquidMechanics;
import liquidmechanics.common.TabLiquidMechanics;
import liquidmechanics.common.handlers.LiquidHandler;
import liquidmechanics.common.tileentity.TileEntityPipe;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class BlockPipe extends BlockMachine
{
public BlockPipe(int id)
{
super("Pipe",id, Material.iron,TabLiquidMechanics.INSTANCE);
this.setBlockBounds(0.30F, 0.30F, 0.30F, 0.70F, 0.70F, 0.70F);
this.setHardness(1f);
this.setResistance(3f);
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public int getRenderType()
{
return BlockRenderHelper.renderID;
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which
* neighbor changed (coordinates passed are their own) Args: x, y, z,
* neighbor blockID
*/
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int blockID)
{
super.onNeighborBlockChange(world, x, y, z, blockID);
}
@Override
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
int var5 = par1World.getBlockId(par2, par3, par4);
return var5 == 0 || blocksList[var5].blockMaterial.isReplaceable();
}
@Override
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
{
return true;
}
@Override
public TileEntity createNewTileEntity(World var1)
{
return new TileEntityPipe();
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
return new ItemStack(LiquidMechanics.blockPipe, 1, meta);
}
}