package common.block;

import common.item.CheatTab;
import common.item.Item;
import common.material.Material;
import common.model.BlockLayer;
import common.rng.Random;
import common.tileentity.TileEntity;
import common.tileentity.TileEntityMobSpawner;
import common.util.BlockPos;
import common.world.State;
import common.world.World;

public class BlockMobSpawner extends BlockContainer
{
	public BlockMobSpawner()
    {
        super(Material.rock);
        this.setTab(CheatTab.tabTech);
    }

    /**
     * Returns a new instance of a block's tile entity class. Called on placing the block.
     */
    public TileEntity createNewTileEntity(World worldIn, int meta)
    {
        return new TileEntityMobSpawner();
    }

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

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

    /**
     * Spawns this Block's drops into the World as EntityItems.
     */
    public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, State state, float chance, int fortune)
    {
        super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
        int i = worldIn.rand.rangeBonus(15, 29, 14);
        this.dropXpOnBlockBreak(worldIn, pos, i);
    }

    /**
     * Used to determine ambient occlusion and culling when rebuilding chunks for render
     */
    public boolean isOpaqueCube()
    {
        return false;
    }

    /**
     * The type of render function called. 3 for standard block models, 2 for TESR's, 1 for liquids, -1 is no render
     */
    public int getRenderType()
    {
        return 3;
    }

    public BlockLayer getBlockLayer()
    {
        return BlockLayer.CUTOUT;
    }

    public Item getItem(World worldIn, BlockPos pos)
    {
        return null;
    }
    
    public boolean isXrayVisible()
    {
        return true;
    }
    
    public boolean isMagnetic() {
    	return true;
    }
}
