added continuity to optional modrinth dependencies + made blocks addition possible by placing correct shape on existing frame
This commit is contained in:
@@ -49,18 +49,10 @@ public enum Edge implements StringIdentifiable {
|
||||
return second_direction;
|
||||
}
|
||||
public Direction getRightDirection() {
|
||||
return switch (axis) {
|
||||
case X -> Direction.WEST;
|
||||
case Y -> Direction.DOWN;
|
||||
case Z -> Direction.SOUTH;
|
||||
};
|
||||
return Direction.from(axis, Direction.AxisDirection.NEGATIVE);
|
||||
}
|
||||
public Direction getLeftDirection() {
|
||||
return switch (axis) {
|
||||
case X -> Direction.EAST;
|
||||
case Y -> Direction.UP;
|
||||
case Z -> Direction.NORTH;
|
||||
};
|
||||
return Direction.from(axis, Direction.AxisDirection.POSITIVE);
|
||||
}
|
||||
|
||||
public boolean hasDirection(Direction direction) {
|
||||
@@ -68,16 +60,32 @@ public enum Edge implements StringIdentifiable {
|
||||
|| this.second_direction.equals(direction);
|
||||
}
|
||||
|
||||
public Direction.Axis getAxis() {
|
||||
return this.axis;
|
||||
}
|
||||
|
||||
public int getID() {
|
||||
return this.ID;
|
||||
}
|
||||
|
||||
public Edge opposite() {
|
||||
return getByDirections(first_direction.getOpposite(), second_direction.getOpposite());
|
||||
}
|
||||
|
||||
public static Edge getByDirections(Direction direction_1, Direction direction_2) {
|
||||
return Arrays.stream(Edge.values())
|
||||
.filter(value -> value.hasDirection(direction_1) && value.hasDirection(direction_2))
|
||||
.findFirst().orElse(Edge.NORTH_DOWN);
|
||||
}
|
||||
|
||||
public boolean isSide(Direction side) {
|
||||
return getRightDirection() == side || getLeftDirection() == side;
|
||||
}
|
||||
|
||||
public Direction getOtherDirection(Direction direction) {
|
||||
return first_direction == direction ? second_direction : first_direction;
|
||||
}
|
||||
|
||||
public static Edge fromId(int id) {
|
||||
return Arrays.stream(Edge.values())
|
||||
.filter(value -> value.getID() == id)
|
||||
|
||||
Reference in New Issue
Block a user