Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.material.Door Class Reference
Inheritance diagram for org.bukkit.material.Door:
org.bukkit.material.MaterialData org.bukkit.material.Directional org.bukkit.material.Openable

Public Member Functions

 Door (final int type)
 
 Door (final Material type)
 
 Door (final int type, final byte data)
 
 Door (final Material type, final byte data)
 
boolean isOpen ()
 
void setOpen (boolean isOpen)
 
boolean isTopHalf ()
 
void setTopHalf (boolean isTopHalf)
 
BlockFace getHingeCorner ()
 
String toString ()
 
void setFacingDirection (BlockFace face)
 
BlockFace getFacing ()
 
Door clone ()
 
- Public Member Functions inherited from org.bukkit.material.MaterialData
 MaterialData (final int type)
 
 MaterialData (final Material type)
 
 MaterialData (final int type, final byte data)
 
 MaterialData (final Material type, final byte data)
 
byte getData ()
 
void setData (byte data)
 
Material getItemType ()
 
int getItemTypeId ()
 
ItemStack toItemStack ()
 
ItemStack toItemStack (int amount)
 
String toString ()
 
int hashCode ()
 
boolean equals (Object obj)
 
MaterialData clone ()
 

Detailed Description

Represents a door.

Deprecated:
No longer functions. Do not use.

Definition at line 12 of file Door.java.

Constructor & Destructor Documentation

org.bukkit.material.Door.Door ( final int  type)
Deprecated:
Magic value

Definition at line 22 of file Door.java.

22  {
23  super(type);
24  }
org.bukkit.material.Door.Door ( final int  type,
final byte  data 
)
Deprecated:
Magic value

Definition at line 35 of file Door.java.

35  {
36  super(type, data);
37  }
org.bukkit.material.Door.Door ( final Material  type,
final byte  data 
)
Deprecated:
Magic value

Definition at line 44 of file Door.java.

44  {
45  super(type, data);
46  }

Member Function Documentation

BlockFace org.bukkit.material.Door.getFacing ( )

Get the direction that this door is facing.

Returns
the direction
Deprecated:
Does not work (correctly) anymore

Implements org.bukkit.material.Directional.

Definition at line 138 of file Door.java.

References org.bukkit.material.MaterialData.getData().

138  {
139  byte data = (byte) (getData() & 0x3);
140  switch (data) {
141  case 0:
142  return BlockFace.WEST;
143 
144  case 1:
145  return BlockFace.NORTH;
146 
147  case 2:
148  return BlockFace.EAST;
149 
150  case 3:
151  return BlockFace.SOUTH;
152  }
153  return null; // shouldn't happen
154  }
BlockFace org.bukkit.material.Door.getHingeCorner ( )
Returns
BlockFace.SELF
Deprecated:
Does not work (correctly) anymore

Definition at line 87 of file Door.java.

References org.bukkit.material.MaterialData.getData().

87  {
88  byte d = getData();
89 
90  if ((d & 0x3) == 0x3) {
91  return BlockFace.NORTH_WEST;
92  } else if ((d & 0x1) == 0x1) {
93  return BlockFace.SOUTH_EAST;
94  } else if ((d & 0x2) == 0x2) {
95  return BlockFace.SOUTH_WEST;
96  }
97 
98  return BlockFace.NORTH_EAST;
99  }
boolean org.bukkit.material.Door.isOpen ( )
Deprecated:
Does not work (correctly) anymore

Implements org.bukkit.material.Openable.

Definition at line 52 of file Door.java.

References org.bukkit.material.MaterialData.getData().

52  {
53  return ((getData() & 0x4) == 0x4);
54  }
boolean org.bukkit.material.Door.isTopHalf ( )
Returns
whether this is the top half of the door

Definition at line 67 of file Door.java.

References org.bukkit.material.MaterialData.getData().

67  {
68  return ((getData() & 0x8) == 0x8);
69  }
void org.bukkit.material.Door.setFacingDirection ( BlockFace  face)

Set the direction that this door should is facing.

Parameters
facethe direction
Deprecated:
Does not work (correctly) anymore

Implements org.bukkit.material.Directional.

Definition at line 113 of file Door.java.

References org.bukkit.material.MaterialData.getData(), and org.bukkit.material.MaterialData.setData().

113  {
114  byte data = (byte) (getData() & 0x12);
115  switch (face) {
116  case NORTH:
117  data |= 0x1;
118  break;
119 
120  case EAST:
121  data |= 0x2;
122  break;
123 
124  case SOUTH:
125  data |= 0x3;
126  break;
127  }
128  setData(data);
129  }
void org.bukkit.material.Door.setOpen ( boolean  isOpen)
Deprecated:
Does not work (correctly) anymore

Implements org.bukkit.material.Openable.

Definition at line 60 of file Door.java.

References org.bukkit.material.MaterialData.getData(), and org.bukkit.material.MaterialData.setData().

60  {
61  setData((byte) (isOpen ? (getData() | 0x4) : (getData() & ~0x4)));
62  }
void org.bukkit.material.Door.setTopHalf ( boolean  isTopHalf)

Configure this part of the door to be either the top or the bottom half

Parameters
isTopHalfTrue to make it the top half.
Deprecated:
Shouldn't be used anymore

Definition at line 78 of file Door.java.

References org.bukkit.material.MaterialData.getData(), and org.bukkit.material.MaterialData.setData().

78  {
79  setData((byte) (isTopHalf ? (getData() | 0x8) : (getData() & ~0x8)));
80  }
boolean isTopHalf()
Definition: Door.java:67

The documentation for this class was generated from the following file: