package com.numbah90.n90ras.blocks;

import com.numbah90.n90ras.creativetabs.CreativeTabBSC;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;

import com.numbah90.n90ras.help.Reference;

import java.util.Random;

public class Blocksucafurnace extends Block 
{
	public Blocksucafurnace(boolean isActive) //Thanks to SatanicSanta for a decent bit of this code.
	{
		super(Material.wood);
		setBlockName("sucafurnace");
        setCreativeTab(CreativeTabBSC.BSC_TAB);
		setStepSound(soundTypeWood);
		setHardness(2.0F);
		setResistance(1.5F);
        isBurning2 = isActive;
	}
	
	@SideOnly(Side.CLIENT)
	public static IIcon otherIcon;
	@SideOnly(Side.CLIENT)
	public static IIcon frontIcon;

    public static boolean isBurning;
    public final boolean isBurning2;
    public final Random random = new Random();
	
	@Override
	@SideOnly(Side.CLIENT)
	public void registerBlockIcons(IIconRegister icon){
		otherIcon = icon.registerIcon(Reference.MODID + ":compsucablock");
		frontIcon = icon.registerIcon(this.isBurning2 ? Reference.MODID + ":sucafurnacelit" : Reference.MODID + ":sucafurnace");
	}
	
	@Override
	@SideOnly(Side.CLIENT)
	public IIcon getIcon(int side, int meta){
		if(side == 3){
			return frontIcon;
		} else {
			return otherIcon;
		}
	}

    /*public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
        player.openGui(Reference.MODID, 0, world, x, y, z);
        return true;
    }*/
}
