Class BlockBed

Direct Known Subclasses:
BedBlockBase

public class BlockBed extends BlockDirectional
  • Field Details

    • footBlockToHeadBlockMap

      public static final int[][] footBlockToHeadBlockMap
      Maps the foot-of-bed block to the head-of-bed block.
  • Constructor Details

    • BlockBed

      public BlockBed(int par1)
  • Method Details

    • onDestroyedByFire

      public void onDestroyedByFire(World world, int x, int y, int z, int iFireAge, boolean bForcedFireSpread)
      Overrides:
      onDestroyedByFire in class Block
    • onBlockActivated

      public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
      Called upon block activation (right click on the block.)
      Overrides:
      onBlockActivated in class Block
    • getIcon

      public Icon getIcon(int par1, int par2)
      From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
      Overrides:
      getIcon in class Block
    • registerIcons

      public void registerIcons(IconRegister par1IconRegister)
      When this method is called, your block should register all the icons it needs with the given IconRegister. This is the only chance you get to register icons.
      Overrides:
      registerIcons in class Block
    • getRenderType

      public int getRenderType()
      The type of render function that is called for this block
      Overrides:
      getRenderType in class Block
    • renderAsNormalBlock

      public boolean renderAsNormalBlock()
      If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
      Overrides:
      renderAsNormalBlock in class Block
    • isOpaqueCube

      public boolean isOpaqueCube()
      Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
      Overrides:
      isOpaqueCube in class Block
    • setBlockBoundsBasedOnState

      public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
      Updates the blocks bounds based on its current state. Args: world, x, y, z
      Overrides:
      setBlockBoundsBasedOnState in class Block
    • onNeighborBlockChange

      public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
      Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor blockID
      Overrides:
      onNeighborBlockChange in class Block
    • idDropped

      public int idDropped(int par1, Random par2Random, int par3)
      Returns the ID of the items to drop on destruction.
      Overrides:
      idDropped in class Block
    • isBlockHeadOfBed

      public static boolean isBlockHeadOfBed(int par0)
      Returns whether or not this bed block is the head of the bed.
    • isBedOccupied

      public static boolean isBedOccupied(int par0)
      Return whether or not the bed is occupied.
    • setBedOccupied

      public static void setBedOccupied(World par0World, int par1, int par2, int par3, boolean par4)
      Sets whether or not the bed is occupied.
    • getNearestEmptyChunkCoordinates

      public static ChunkCoordinates getNearestEmptyChunkCoordinates(World par0World, int par1, int par2, int par3, int par4)
      Gets the nearest empty chunk coordinates for the player to wake up from a bed into.
    • dropBlockAsItemWithChance

      public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
      Drops the block items with a specified chance of dropping the specified items
      Overrides:
      dropBlockAsItemWithChance in class Block
    • getMobilityFlag

      public int getMobilityFlag()
      Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and stop pistons
      Overrides:
      getMobilityFlag in class Block
    • idPicked

      public int idPicked(World par1World, int par2, int par3, int par4)
      only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
      Overrides:
      idPicked in class Block
    • onBlockHarvested

      public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer)
      Called when the block is attempted to be harvested
      Overrides:
      onBlockHarvested in class Block