mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
parent
e9e58e4fce
commit
82725b5e32
@ -60,4 +60,21 @@ public enum BlockFace {
|
|||||||
return BlockFace.WEST;
|
return BlockFace.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