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

Method getFacing

src/main/java/org/bukkit/material/Sign.java:74–132  ·  view source on GitHub ↗

Gets the direction that this sign is currently facing @return BlockFace indicating where this sign is facing

()

Source from the content-addressed store, hash-verified

72 * @return BlockFace indicating where this sign is facing
73 */
74 public BlockFace getFacing() {
75 byte data = getData();
76
77 if (!isWallSign()) {
78 switch (data) {
79 case 0x0:
80 return BlockFace.WEST;
81
82 case 0x1:
83 return BlockFace.WEST_NORTH_WEST;
84
85 case 0x2:
86 return BlockFace.NORTH_WEST;
87
88 case 0x3:
89 return BlockFace.NORTH_NORTH_WEST;
90
91 case 0x4:
92 return BlockFace.NORTH;
93
94 case 0x5:
95 return BlockFace.NORTH_NORTH_EAST;
96
97 case 0x6:
98 return BlockFace.NORTH_EAST;
99
100 case 0x7:
101 return BlockFace.EAST_NORTH_EAST;
102
103 case 0x8:
104 return BlockFace.EAST;
105
106 case 0x9:
107 return BlockFace.EAST_SOUTH_EAST;
108
109 case 0xA:
110 return BlockFace.SOUTH_EAST;
111
112 case 0xB:
113 return BlockFace.SOUTH_SOUTH_EAST;
114
115 case 0xC:
116 return BlockFace.SOUTH;
117
118 case 0xD:
119 return BlockFace.SOUTH_SOUTH_WEST;
120
121 case 0xE:
122 return BlockFace.SOUTH_WEST;
123
124 case 0xF:
125 return BlockFace.WEST_SOUTH_WEST;
126 }
127
128 return null;
129 } else {
130 return getAttachedFace().getOppositeFace();
131 }

Callers 1

toStringMethod · 0.95

Calls 4

isWallSignMethod · 0.95
getAttachedFaceMethod · 0.95
getOppositeFaceMethod · 0.80
getDataMethod · 0.65

Tested by

no test coverage detected