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