001package net.minecraft.block;
002
003import net.minecraft.block.material.Material;
004import net.minecraft.creativetab.CreativeTabs;
005import net.minecraft.entity.player.EntityPlayer;
006import net.minecraft.tileentity.TileEntity;
007import net.minecraft.tileentity.TileEntityBeacon;
008import net.minecraft.world.World;
009
010public class BlockBeacon extends BlockContainer
011{
012    public BlockBeacon(int par1)
013    {
014        super(par1, 41, Material.glass);
015        this.setHardness(3.0F);
016        this.setCreativeTab(CreativeTabs.tabMisc);
017    }
018
019    /**
020     * Returns a new instance of a block's tile entity class. Called on placing the block.
021     */
022    public TileEntity createNewTileEntity(World par1World)
023    {
024        return new TileEntityBeacon();
025    }
026
027    /**
028     * Called upon block activation (right click on the block.)
029     */
030    public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
031    {
032        if (par1World.isRemote)
033        {
034            return true;
035        }
036        else
037        {
038            TileEntityBeacon var10 = (TileEntityBeacon)par1World.getBlockTileEntity(par2, par3, par4);
039
040            if (var10 != null)
041            {
042                par5EntityPlayer.displayGUIBeacon(var10);
043            }
044
045            return true;
046        }
047    }
048
049    /**
050     * Is this block (a) opaque and (b) a full 1m cube?  This determines whether or not to render the shared face of two
051     * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
052     */
053    public boolean isOpaqueCube()
054    {
055        return false;
056    }
057
058    /**
059     * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
060     */
061    public boolean renderAsNormalBlock()
062    {
063        return false;
064    }
065
066    /**
067     * The type of render function that is called for this block
068     */
069    public int getRenderType()
070    {
071        return 34;
072    }
073}