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

Public Member Functions

 Stairs (final int type)
 
 Stairs (final Material type)
 
 Stairs (final int type, final byte data)
 
 Stairs (final Material type, final byte data)
 
BlockFace getAscendingDirection ()
 
BlockFace getDescendingDirection ()
 
void setFacingDirection (BlockFace face)
 
BlockFace getFacing ()
 
boolean isInverted ()
 
void setInverted (boolean inv)
 
String toString ()
 
Stairs 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 stairs.

Definition at line 9 of file Stairs.java.

Constructor & Destructor Documentation

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

Definition at line 16 of file Stairs.java.

16  {
17  super(type);
18  }
org.bukkit.material.Stairs.Stairs ( final int  type,
final byte  data 
)
Deprecated:
Magic value

Definition at line 29 of file Stairs.java.

29  {
30  super(type, data);
31  }
org.bukkit.material.Stairs.Stairs ( final Material  type,
final byte  data 
)
Deprecated:
Magic value

Definition at line 38 of file Stairs.java.

38  {
39  super(type, data);
40  }

Member Function Documentation

BlockFace org.bukkit.material.Stairs.getAscendingDirection ( )
Returns
the direction the stairs ascend towards

Definition at line 45 of file Stairs.java.

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

Referenced by org.bukkit.material.Stairs.getDescendingDirection().

45  {
46  byte data = getData();
47 
48  switch (data & 0x3) {
49  case 0x0:
50  default:
51  return BlockFace.EAST;
52 
53  case 0x1:
54  return BlockFace.WEST;
55 
56  case 0x2:
57  return BlockFace.SOUTH;
58 
59  case 0x3:
60  return BlockFace.NORTH;
61  }
62  }
BlockFace org.bukkit.material.Stairs.getDescendingDirection ( )
Returns
the direction the stairs descend towards

Definition at line 67 of file Stairs.java.

References org.bukkit.material.Stairs.getAscendingDirection().

Referenced by org.bukkit.material.Stairs.getFacing().

67  {
68  return getAscendingDirection().getOppositeFace();
69  }
BlockFace getAscendingDirection()
Definition: Stairs.java:45
BlockFace org.bukkit.material.Stairs.getFacing ( )
Returns
the direction the stair part of the block is facing

Implements org.bukkit.material.Directional.

Definition at line 102 of file Stairs.java.

References org.bukkit.material.Stairs.getDescendingDirection().

102  {
103  return getDescendingDirection();
104  }
BlockFace getDescendingDirection()
Definition: Stairs.java:67
boolean org.bukkit.material.Stairs.isInverted ( )

Test if step is inverted

Returns
true if inverted (top half), false if normal (bottom half)

Definition at line 111 of file Stairs.java.

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

111  {
112  return ((getData() & 0x4) != 0);
113  }
void org.bukkit.material.Stairs.setFacingDirection ( BlockFace  face)

Set the direction the stair part of the block is facing

Implements org.bukkit.material.Directional.

Definition at line 74 of file Stairs.java.

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

74  {
75  byte data;
76 
77  switch (face) {
78  case NORTH:
79  data = 0x3;
80  break;
81 
82  case SOUTH:
83  data = 0x2;
84  break;
85 
86  case EAST:
87  default:
88  data = 0x0;
89  break;
90 
91  case WEST:
92  data = 0x1;
93  break;
94  }
95 
96  setData((byte) ((getData() & 0xC) | data));
97  }
void org.bukkit.material.Stairs.setInverted ( boolean  inv)

Set step inverted state

Parameters
inv- true if step is inverted (top half), false if step is normal (bottom half)

Definition at line 121 of file Stairs.java.

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

121  {
122  int dat = getData() & 0x3;
123  if (inv) {
124  dat |= 0x4;
125  }
126  setData((byte) dat);
127  }

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