package common.block.foliage;

import common.block.Block;
import common.block.Material;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
import common.model.Model;
import common.model.ModelProvider;
import common.rng.Random;
import common.world.State;

public class BlockMelon extends Block
{
	public BlockMelon()
    {
        super(Material.SOFT);
        this.setTab(CheatTab.PLANTS);
    }

    /**
     * Get the Item that this Block should drop when harvested.
     */
    public Item getItemDropped(State state, Random rand, int fortune)
    {
        return Items.melon;
    }

    /**
     * Returns the quantity of items to drop on block destruction.
     */
    public int quantityDropped(Random random)
    {
        return random.range(3, 7);
    }

    /**
     * Get the quantity dropped based on the given fortune level
     */
    public int quantityDroppedWithBonus(int fortune, Random random)
    {
        return Math.min(9, this.quantityDropped(random) + random.zrange(1 + fortune));
    }
    
    public Model getModel(ModelProvider provider, String name, State state) {
    	return provider.getModel("melon_side").add().nswe().du("melon_top");
    }
}
