mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
Add BlockFace#fromDirection
This commit is contained in:
parent
aebf72de90
commit
cc39a90857
@ -32,4 +32,21 @@ public enum BlockFace {
|
|||||||
case EAST -> WEST;
|
case EAST -> WEST;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the BlockFace corresponding to the given {@link Direction}.
|
||||||
|
*
|
||||||
|
* @param direction the direction
|
||||||
|
* @return the corresponding BlockFace
|
||||||
|
*/
|
||||||
|
public static BlockFace fromDirection(Direction direction) {
|
||||||
|
return switch (direction) {
|
||||||
|
case UP -> TOP;
|
||||||
|
case DOWN -> BOTTOM;
|
||||||
|
case NORTH -> NORTH;
|
||||||
|
case SOUTH -> SOUTH;
|
||||||
|
case WEST -> WEST;
|
||||||
|
case EAST -> EAST;
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user