gt: 						float f = random.nextFloat() * 0.8F + 0.1F;
context: package com.keeperofmee.survival.blocks.machines;
  
  import java.util.Random;
  
  import net.minecraft.block.Block;
  import net.minecraft.block.BlockContainer;
  import net.minecraft.block.material.Material;
  import net.minecraft.client.renderer.texture.IIconRegister;
  import net.minecraft.entity.EntityLivingBase;
  import net.minecraft.entity.item.EntityItem;
  import net.minecraft.entity.player.EntityPlayer;
  import net.minecraft.inventory.Container;
  import net.minecraft.inventory.IInventory;
  import net.minecraft.item.Item;
  import net.minecraft.item.ItemStack;
  import net.minecraft.nbt.NBTTagCompound;
  import net.minecraft.tileentity.TileEntity;
  import net.minecraft.util.IIcon;
  import net.minecraft.util.MathHelper;
  import net.minecraft.world.World;
  
  import com.keeperofmee.survival.api.electricity.IConnectSPCable;
  import com.keeperofmee.survival.handlers.SurvivalGuiHandler;
  import com.keeperofmee.survival.init.SurvivalBlocks;
  import com.keeperofmee.survival.library.SurvivalReference;
  import com.keeperofmee.survival.main.Survival;
  import com.keeperofmee.survival.tileentity.TileEntityMacerator;
  
  import cpw.mods.fml.relauncher.Side;
  import cpw.mods.fml.relauncher.SideOnly;
  
  public class SmMacerator extends BlockContainer implements IConnectSPCable
  {
  	private final Random random = new Random();
  	private final boolean isActive;
  	private static boolean state;
  	@SideOnly(Side.CLIENT)
  	private IIcon iconTop;
  	@SideOnly(Side.CLIENT)
  	private IIcon iconFront;
  
  	public SmMacerator(boolean isBurning)
  	{
  		super(Material.rock);
  		this.setHardness(5F);
  		this.setHarvestLevel("pickaxe", 0);
  		isActive = isBurning;
  	}
  
  	@Override
  	public Item getItemDropped(int i, Random rand, int i1)
  	{
  		return Item.getItemFromBlock(SurvivalBlocks.idleMacerator);
  	}
  
  	@Override
  	public void onBlockAdded(World world, int x, int y, int z)
  	{
  		super.onBlockAdded(world, x, y, z);
  		this.setDirection(world, x, y, z);
  	}
  
  	private void setDirection(World world, int x, int y, int z)
  	{
  		if (!world.isRemote)
  		{
  			Block block = world.getBlock(x, y, z - 1);
  			Block block1 = world.getBlock(x, y, z + 1);
  			Block block2 = world.getBlock(x - 1, y, z);
  			Block block3 = world.getBlock(x + 1, y, z);
  			byte b0 = 3;
  
  			if (block.func_149730_j() && !block1.func_149730_j())
  			{
  				b0 = 3;
  			}
  
  			if (block1.func_149730_j() && !block.func_149730_j())
  			{
  				b0 = 2;
  			}
  
  			if (block2.func_149730_j() && !block3.func_149730_j())
  			{
  				b0 = 5;
  			}
  
  			if (block3.func_149730_j() && !block2.func_149730_j())
  			{
  				b0 = 4;
  			}
  
  			world.setBlockMetadataWithNotify(x, y, z, b0, 2);
  		}
  	}
  
  	@Override
  	@SideOnly(Side.CLIENT)
  	public IIcon getIcon(int side, int meta)
  	{
  		if(side == 3 && meta == 0){
  			return iconFront;
  		}
  		return side == 1 ? iconTop : (side == 0 ? iconTop : (side != meta ? blockIcon : iconFront));
  	}
  
  	@Override
  	@SideOnly(Side.CLIENT)
  	public void registerBlockIcons(IIconRegister iconRegister)
  	{
  		blockIcon = iconRegister.registerIcon(SurvivalReference.TEXTUREPATH + "macerator_side");
  		iconFront = iconRegister.registerIcon(isActive ?SurvivalReference.TEXTUREPATH + "macerator_front_on" : SurvivalReference.TEXTUREPATH +  "macerator_front_off");
  		iconTop = iconRegister.registerIcon(SurvivalReference.TEXTUREPATH + "macerator_top");
  	}
  
  	@Override
  	public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float f, float g, float t){
  		TileEntity tile_entity = world.getTileEntity(x, y, z);
  
  		if(tile_entity == null || player.isSneaking()){
  
  			return false;
  		}
  		player.openGui(Survival.instance, SurvivalGuiHandler.guiMaceratorID, world, x, y, z);
  
  		return true;
  	}
  
  	public static void updateBlockState(boolean isBurning, World world, int x, int y, int z)
  	{
  		int l = world.getBlockMetadata(x, y, z);
  		TileEntity tileentity = world.getTileEntity(x, y, z);
  		state = true;
  
  		if (isBurning)
  		{
  			world.setBlock(x, y, z, SurvivalBlocks.litMacerator);
  		}
  		else
  		{
  			world.setBlock(x, y, z, SurvivalBlocks.idleMacerator);
  		}
  
  		state = false;
  		world.setBlockMetadataWithNotify(x, y, z, l, 2);
  
  		if (tileentity != null)
  		{
  			tileentity.validate();
  			world.setTileEntity(x, y, z, tileentity);
  		}
  	}
  
  	@Override
  	public TileEntity createNewTileEntity(World world, int i)
  	{
  		return new TileEntityMacerator();
  	}
  
  	@Override
  	public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase livingBase, ItemStack itemstack)
  	{
  		int l = MathHelper.floor_double(livingBase.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
  
  		if (l == 0)
  		{
  			world.setBlockMetadataWithNotify(x, y, z, 2, 2);
  		}
  
  		if (l == 1)
  		{
  			world.setBlockMetadataWithNotify(x, y, z, 5, 2);
  		}
  
  		if (l == 2)
  		{
  			world.setBlockMetadataWithNotify(x, y, z, 3, 2);
  		}
  
  		if (l == 3)
  		{
  			world.setBlockMetadataWithNotify(x, y, z, 4, 2);
  		}
  
  		if (itemstack.hasDisplayName())
  		{
  			((TileEntityMacerator)world.getTileEntity(x, y, z)).func_145951_a(itemstack.getDisplayName());
  		}
  	}
  
  	@Override
  	public void breakBlock(World world, int x, int y, int z, Block block, int i)
  	{
  		if (!state)
  		{
  			TileEntityMacerator tileentitymacerator = (TileEntityMacerator)world.getTileEntity(x, y, z);
  
  			if (tileentitymacerator != null)
  			{
  				for (int i1 = 0; i1 < tileentitymacerator.getSizeInventory(); ++i1)
  				{
  					ItemStack itemstack = tileentitymacerator.getStackInSlot(i1);
  
  					if (itemstack != null)
  					{
  