MCPcopy Create free account
hub / github.com/Bukkit/Bukkit / Stairs

Class Stairs

src/main/java/org/bukkit/material/Stairs.java:9–95  ·  view source on GitHub ↗

Represents stairs.

Source from the content-addressed store, hash-verified

7 * Represents stairs.
8 */
9public class Stairs extends MaterialData implements Directional {
10
11 public Stairs(final int type) {
12 super(type);
13 }
14
15 public Stairs(final Material type) {
16 super(type);
17 }
18
19 public Stairs(final int type, final byte data) {
20 super(type, data);
21 }
22
23 public Stairs(final Material type, final byte data) {
24 super(type, data);
25 }
26
27 /**
28 * @return the direction the stairs ascend towards
29 */
30 public BlockFace getAscendingDirection() {
31 byte data = getData();
32
33 switch (data) {
34 case 0x0:
35 default:
36 return BlockFace.SOUTH;
37
38 case 0x1:
39 return BlockFace.NORTH;
40
41 case 0x2:
42 return BlockFace.WEST;
43
44 case 0x3:
45 return BlockFace.EAST;
46 }
47 }
48
49 /**
50 * @return the direction the stairs descend towards
51 */
52 public BlockFace getDescendingDirection() {
53 return getAscendingDirection().getOppositeFace();
54 }
55
56 /**
57 * Set the direction the stair part of the block is facing
58 */
59 public void setFacingDirection(BlockFace face) {
60 byte data;
61
62 switch (face) {
63 case NORTH:
64 default:
65 data = 0x0;
66 break;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected