package frogcraftrebirth.common.block;

import java.util.Random;

import frogcraftrebirth.common.lib.block.BlockFrog;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockFrogOre extends BlockFrog {
	
	public static final PropertyEnum<Type> TYPE = PropertyEnum.<Type>create("type", Type.class);

	public BlockFrogOre() {
		super(ORE, "ore", 0, 1, 2);
		setUnlocalizedName("mineral");
		setHardness(5.0F);
		setResistance(15.0f);
		setDefaultState(this.blockState.getBaseState().withProperty(TYPE, Type.CARNALLITE));
	}

	@Override
	protected IProperty<?>[] getPropertyArray() {
		return new IProperty[] { TYPE };
	}

	@Deprecated
	@Override
	public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) {
		if (blockState.getBlock().getMetaFromState(blockState) == 3)
			return 1.0F;
		else
			return super.getBlockHardness(blockState, worldIn, pos);
	}
	
	public Item getItemDropped(int meta, Random rand, int fortune) {
		return Item.getItemFromBlock(this);
	}

	@Override
	public int quantityDropped(IBlockState state, int fortune, Random random) {
		if (state.getBlock().getMetaFromState(state) ==5) {
			int i = 1;
			for (int n = 0; n < fortune; n++) {
			if (random.nextInt(3) == 1)
				++i;
			}
			return i;
		}
		
		return 1;
	}
	
	@Override
	public int getMetaFromState(IBlockState state) {
		return state.getValue(TYPE).ordinal();
	}
	
	@Override
	public IBlockState getStateFromMeta(int meta) {
		return this.blockState.getBaseState().withProperty(TYPE, Type.values()[meta]);
	}
	
	public static enum Type implements IStringSerializable {
		CARNALLITE, DEWALQUITE, FLUORAPATITE/*, NGH*/;
		//Natural Gas Hydrate is canceled again...

		@Override
		public String getName() {
			return this.name().toLowerCase();
		}
	}

}

@@ -340,83 +340,8 @@
 ble;
-%0Aimport net.minecraft.util.math.BlockPos;%0Aimport net.minecraft.world.World;
 %0A%0Apu
@@ -804,268 +804,8 @@
 ;%0A%09%7D
-%0A%0A%09@Deprecated%0A%09@Override%0A%09public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) %7B%0A%09%09if (blockState.getBlock().getMetaFromState(blockState) == 3)%0A%09%09%09return 1.0F;%0A%09%09else%0A%09%09%09return super.getBlockHardness(blockState, worldIn, pos);%0A%09%7D
 %0A%09%0A%09

Remove a legacy overrided method