package crazypants.enderio.material;

import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.BlockEio;
import crazypants.enderio.ModObject;

public class BlockIngotStorage extends BlockEio {
  
  @SideOnly(Side.CLIENT)
  private IIcon[] icons;

  public static BlockIngotStorage create() {
    BlockIngotStorage res = new BlockIngotStorage();
    res.init();
    return res;
  }
  
  private BlockIngotStorage() {
    super(ModObject.blockIngotStorage.unlocalisedName, null, Material.iron);
    setStepSound(soundTypeMetal);
  }
  
  @Override
  protected void init() {
    GameRegistry.registerBlock(this, BlockItemIngotStorage.class, ModObject.blockIngotStorage.unlocalisedName);
  }
  
  @Override
  @SideOnly(Side.CLIENT)
  public void registerBlockIcons(IIconRegister register) {
    icons = new IIcon[Alloy.values().length];
    for (Alloy alloy : Alloy.values()) {
      icons[alloy.ordinal()] = register.registerIcon(alloy.iconKey + "Block");
    }
  }
  
  @Override
  @SideOnly(Side.CLIENT)
  public IIcon getIcon(int side, int meta) {
    meta = MathHelper.clamp_int(meta, 0, Alloy.values().length - 1);
    return icons[meta];
  }
  
  @Override
  public int getDamageValue(World world, int x, int y, int z) {
    return world.getBlockMetadata(x, y, z);
  }
  
  @Override
  public int damageDropped(int meta) {
    return meta;
  }
  
  @Override
  public float getBlockHardness(World world, int x, int y, int z) {
    return Alloy.values()[world.getBlockMetadata(x, y, z)].getHardness();
  }
  
  @Override
  public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) {
    return getBlockHardness(world, x, y, z) * 2.0f; // vanilla default is / 5.0f, this means hardness*2 = resistance
  }
}

@@ -31,16 +31,40 @@
 erial;%0A%0A
+import java.util.List;%0A%0A
 import n
@@ -197,16 +197,102 @@
 Entity;%0A
+import net.minecraft.entity.player.EntityPlayer;%0Aimport net.minecraft.item.ItemStack;%0A
 import n
@@ -350,24 +350,65 @@
 MathHelper;%0A
+import net.minecraft.world.IBlockAccess;%0A
 import net.m
@@ -629,16 +629,101 @@
 dObject;
+%0Aimport crazypants.enderio.gui.IAdvancedTooltipProvider;%0Aimport crazypants.util.Lang;
 %0A%0Apublic
@@ -764,16 +764,52 @@
 lockEio 
+implements IAdvancedTooltipProvider 
 %7B%0A  %0A  @
@@ -2403,10 +2403,596 @@
 nce%0A  %7D%0A
+  %0A  @Override%0A  public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) %7B%0A    return true;%0A  %7D%0A%0A  @Override%0A  public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) %7B%0A    list.add(Lang.localize(%22tooltip.isBeaconBase%22));%0A  %7D%0A%0A  @Override%0A  public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) %7B%0A    ;%0A  %7D%0A%0A  @Override%0A  public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) %7B%0A    ;%0A  %7D%0A
 %7D%0A

Make ingot blocks useable as beacon bases