package ihl.tunneling_shield; import ic2.core.IC2; import ic2.core.Ic2Items; import ic2.core.audio.PositionSpec; import ic2.core.item.tool.ItemToolWrench; import ihl.IHLMod; import java.util.ArrayList; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class HorizontalMiningPipe extends Block { public static ArrayList teList = new ArrayList(); public HorizontalMiningPipe() { super(Material.iron); this.setBlockBounds(0.1875F, 0.1875F, 0.1875F, 0.8125F, 0.8125F, 0.8125F); } public HorizontalMiningPipe(int meta) { super(Material.iron); this.setBlockBounds(0.1875F*meta, 0.1875F, 0.1875F*(1-meta), 0.8125F+0.1875F*(1-meta), 0.8125F, 0.8125F+0.1875F*meta); } @Override public boolean canHarvestBlock(EntityPlayer player, int meta) { return true; } @Override public Item getItem(World world, int x, int y, int z) { return Ic2Items.miningPipe.getItem(); } @Override public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return Ic2Items.miningPipe.getItem(); } @Override public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int flag) { ItemStack result = Ic2Items.miningPipe; result.stackSize=1; this.dropBlockAsItem(world, x, y, z, result); } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("ic2:machine/blockMiningPipe"); } @Override public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { return this.blockIcon; } /** * The type of render function that is called for this block */ @Override public int getRenderType() { return -2; } /** * Is this block (a) opaque and (B) a full 1m cube? This determines whether or not to render the shared face of two * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. */ @Override public boolean isOpaqueCube() { return false; } /** * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ @Override public boolean renderAsNormalBlock() { return false; } @Override public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion) { super.onBlockDestroyedByExplosion(world, x, y, z, explosion); this.checkIfMachinePart(world, x, y, z); } @Override public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta) { super.onBlockDestroyedByPlayer(world, x, y, z, meta); this.checkIfMachinePart(world, x, y, z); } private void checkIfMachinePart(World world, int x, int y, int z) { if(teList.size()>0) { for (int i=0;i0) { for (int i=0;i0) { for (int i3=0;i3