    001package net.minecraft.block;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import java.util.Random;
    006import net.minecraft.block.material.Material;
    007import net.minecraft.tileentity.TileEntity;
    008import net.minecraft.tileentity.TileEntityMobSpawner;
    009import net.minecraft.world.World;
    010
    011public class BlockMobSpawner extends BlockContainer
    012{
    013    protected BlockMobSpawner(int par1, int par2)
    014    {
    015        super(par1, par2, Material.rock);
    016    }
    017
    018    /**
    019     * Returns a new instance of a block's tile entity class. Called on placing the block.
    020     */
    021    public TileEntity createNewTileEntity(World par1World)
    022    {
    023        return new TileEntityMobSpawner();
    024    }
    025
    026    /**
    027     * Returns the ID of the items to drop on destruction.
    028     */
    029    public int idDropped(int par1, Random par2Random, int par3)
    030    {
    031        return 0;
    032    }
    033
    034    /**
    035     * Returns the quantity of items to drop on block destruction.
    036     */
    037    public int quantityDropped(Random par1Random)
    038    {
    039        return 0;
    040    }
    041
    042    /**
    043     * Drops the block items with a specified chance of dropping the specified items
    044     */
    045    public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
    046    {
    047        super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7);
    048        int var8 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15);
    049        this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8);
    050    }
    051
    052    /**
    053     * Is this block (a) opaque and (b) a full 1m cube?  This determines whether or not to render the shared face of two
    054     * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
    055     */
    056    public boolean isOpaqueCube()
    057    {
    058        return false;
    059    }
    060
    061    @SideOnly(Side.CLIENT)
    062
    063    /**
    064     * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
    065     */
    066    public int idPicked(World par1World, int par2, int par3, int par4)
    067    {
    068        return 0;
    069    }
    070}