org.bukkit.material
Class Bed

java.lang.Object
  extended by org.bukkit.material.MaterialData
      extended by org.bukkit.material.Bed
All Implemented Interfaces:
Cloneable, Directional

public class Bed
extends MaterialData
implements Directional

Represents a bed.


Constructor Summary
Bed()
          Default constructor for a bed.
Bed(BlockFace direction)
          Instantiate a bed facing in a particular direction.
Bed(int type)
          Deprecated. Magic value
Bed(int type, byte data)
          Deprecated. Magic value
Bed(Material type)
           
Bed(Material type, byte data)
          Deprecated. Magic value
 
Method Summary
 Bed clone()
           
 BlockFace getFacing()
          Get the direction that this bed's head is facing toward
 boolean isHeadOfBed()
          Determine if this block represents the head of the bed
 void setFacingDirection(BlockFace face)
          Set which direction the head of the bed is facing.
 void setHeadOfBed(boolean isHeadOfBed)
          Configure this to be either the head or the foot of the bed
 String toString()
           
 
Methods inherited from class org.bukkit.material.MaterialData
equals, getData, getItemType, getItemTypeId, hashCode, setData, toItemStack, toItemStack
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Bed

public Bed()
Default constructor for a bed.


Bed

public Bed(BlockFace direction)
Instantiate a bed facing in a particular direction.

Parameters:
direction - the direction the bed's head is facing

Bed

@Deprecated
public Bed(int type)
Deprecated. Magic value


Bed

public Bed(Material type)

Bed

@Deprecated
public Bed(int type,
                      byte data)
Deprecated. Magic value


Bed

@Deprecated
public Bed(Material type,
                      byte data)
Deprecated. Magic value

Method Detail

isHeadOfBed

public boolean isHeadOfBed()
Determine if this block represents the head of the bed

Returns:
true if this is the head of the bed, false if it is the foot

setHeadOfBed

public void setHeadOfBed(boolean isHeadOfBed)
Configure this to be either the head or the foot of the bed

Parameters:
isHeadOfBed - True to make it the head.

setFacingDirection

public void setFacingDirection(BlockFace face)
Set which direction the head of the bed is facing. Note that this will only affect one of the two blocks the bed is made of.

Specified by:
setFacingDirection in interface Directional
Parameters:
face - The facing direction

getFacing

public BlockFace getFacing()
Get the direction that this bed's head is facing toward

Specified by:
getFacing in interface Directional
Returns:
the direction the head of the bed is facing

toString

public String toString()
Overrides:
toString in class MaterialData

clone

public Bed clone()
Overrides:
clone in class MaterialData


Copyright © 2013. All Rights Reserved.