Package org.bukkit.material
Class Bed
java.lang.Object
org.bukkit.material.MaterialData
org.bukkit.material.Bed
- All Implemented Interfaces:
java.lang.Cloneable
,Directional
public class Bed extends MaterialData implements Directional
Represents a bed.
-
Constructor Summary
Constructors Constructor Description Bed()
Default constructor for a bed.Bed(int type)
Deprecated.Magic valueBed(int type, byte data)
Deprecated.Magic valueBed(BlockFace direction)
Instantiate a bed facing in a particular direction.Bed(Material type)
Bed(Material type, byte data)
Deprecated.Magic value -
Method Summary
Modifier and Type Method Description Bed
clone()
BlockFace
getFacing()
Get the direction that this bed's head is facing towardboolean
isHeadOfBed()
Determine if this block represents the head of the bedvoid
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 bedjava.lang.String
toString()
Methods inherited from class org.bukkit.material.MaterialData
equals, getData, getItemType, getItemTypeId, hashCode, setData, toItemStack, toItemStack
-
Constructor Details
-
Bed
public Bed()Default constructor for a bed. -
Bed
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- Parameters:
type
- the raw type id
-
Bed
-
Bed
@Deprecated public Bed(int type, byte data)Deprecated.Magic value- Parameters:
type
- the raw type iddata
- the raw data value
-
Bed
Deprecated.Magic value- Parameters:
type
- the typedata
- the raw data value
-
-
Method Details
-
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
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 interfaceDirectional
- Parameters:
face
- The facing direction
-
getFacing
Get the direction that this bed's head is facing toward- Specified by:
getFacing
in interfaceDirectional
- Returns:
- the direction the head of the bed is facing
-
toString
public java.lang.String toString()- Overrides:
toString
in classMaterialData
-
clone
- Overrides:
clone
in classMaterialData
-