package com.zivilon.cinder_loe.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;

import lotr.common.LOTRCreativeTabs;

import java.lang.reflect.Field;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BlockRedDwarfSteel extends Block {

    public BlockRedDwarfSteel() {
        super(Material.iron); // Choose the appropriate material
        try {
            Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabBlock"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to
            LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null);
            setCreativeTab((CreativeTabs)tab);
        } catch (NoSuchFieldException | IllegalAccessException e) {
            e.printStackTrace();
        }
        setHardness(5.0F);
        setResistance(15.0F);
        setStepSound(Block.soundTypeMetal);
        setBlockTextureName("lotr:red_dwarf_steel");
        setBlockName("lotr:blockRedDwarfSteel");
    }

    @SideOnly(Side.CLIENT)
    public void registerBlockIcons(IIconRegister iconRegister) {
        this.blockIcon = iconRegister.registerIcon("lotr:red_dwarf_steel");
    }
}
