mirror of
https://github.com/Minestom/Minestom.git
synced 2024-06-26 06:24:54 +02:00
36 lines
802 B
Java
36 lines
802 B
Java
package net.minestom.server.instance.block;
|
|
|
|
import net.minestom.server.utils.Direction;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
public enum BlockFace {
|
|
BOTTOM(Direction.DOWN),
|
|
TOP(Direction.UP),
|
|
NORTH(Direction.NORTH),
|
|
SOUTH(Direction.SOUTH),
|
|
WEST(Direction.WEST),
|
|
EAST(Direction.EAST);
|
|
|
|
private final Direction direction;
|
|
|
|
BlockFace(Direction direction) {
|
|
this.direction = direction;
|
|
}
|
|
|
|
public Direction toDirection() {
|
|
return direction;
|
|
}
|
|
|
|
@NotNull
|
|
public BlockFace getOppositeFace() {
|
|
return switch (this) {
|
|
case BOTTOM -> TOP;
|
|
case TOP -> BOTTOM;
|
|
case NORTH -> SOUTH;
|
|
case SOUTH -> NORTH;
|
|
case WEST -> EAST;
|
|
case EAST -> WEST;
|
|
};
|
|
}
|
|
}
|