package com.tjb12.metalmagics.block;

import com.tjb12.metalmagics.init.ModItems;
import com.tjb12.metalmagics.reference.Names;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;

import java.util.Random;

public class BlockInterravitraeOre extends BlockMM
{
    private Item drop;
    private int meta;
    private int least_quantity;
    private int most_quantity;

    public BlockInterravitraeOre(Item drop, int meta, int least_quantity, int most_quantity)
    {
        super(Names.Blocks.INTERRAVITRAE_ORE);
        this.drop = drop;
        this.meta = meta;
        this.least_quantity = least_quantity;
        this.most_quantity = most_quantity;
        this.setLightLevel(0.5F);
        this.setHardness(5F);
    }

    @Override
    public Item getItemDropped(IBlockState blockstate, Random random, int fortune) {
        return this.drop;
    }

    @Override
    public int damageDropped(IBlockState blockstate) {
        return this.meta;
    }

    @Override
    public int quantityDropped(IBlockState blockstate, int fortune, Random random) {
        if (this.least_quantity >= this.most_quantity)
            return this.least_quantity;
        return this.least_quantity + random.nextInt(this.most_quantity - this.least_quantity + fortune + 1);
    }
}
