mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-31 22:22:49 +00:00
SPIGOT-6416: Add BlockFace#isCartesian()
This commit is contained in:
parent
15ba9ae78a
commit
bb27a6c723
1 changed files with 20 additions and 0 deletions
|
@ -84,6 +84,26 @@ public enum BlockFace {
|
|||
return direction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this face is aligned with one of the unit axes in 3D
|
||||
* Cartesian space (ie NORTH, SOUTH, EAST, WEST, UP, DOWN).
|
||||
*
|
||||
* @return Cartesian status
|
||||
*/
|
||||
public boolean isCartesian() {
|
||||
switch (this) {
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
case EAST:
|
||||
case WEST:
|
||||
case UP:
|
||||
case DOWN:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public BlockFace getOppositeFace() {
|
||||
switch (this) {
|
||||
|
|
Loading…
Add table
Reference in a new issue