-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bb8528
commit b039329
Showing
15 changed files
with
181 additions
and
352 deletions.
There are no files selected for viewing
17 changes: 0 additions & 17 deletions
17
src/api/java/mods/railcraft/api/core/ClientAccessException.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,31 @@ | ||
package mods.railcraft.api.track; | ||
|
||
import javax.annotation.Nullable; | ||
import net.minecraft.world.level.block.state.properties.RailShape; | ||
|
||
public final class RailShapeUtil { | ||
|
||
private RailShapeUtil() {} | ||
|
||
public static boolean isLevelStraight(@Nullable RailShape dir) { | ||
return dir != null && dir.ordinal() < 2; | ||
public static boolean isLevelStraight(RailShape railShape) { | ||
return railShape == RailShape.NORTH_SOUTH || railShape == RailShape.EAST_WEST; | ||
} | ||
|
||
public static boolean isStraight(@Nullable RailShape dir) { | ||
return dir != null && dir.ordinal() < 6; | ||
public static boolean isEastWest(RailShape railShape) { | ||
return (railShape == RailShape.EAST_WEST | ||
|| railShape == RailShape.ASCENDING_EAST | ||
|| railShape == RailShape.ASCENDING_WEST); | ||
} | ||
|
||
public static boolean isEastWest(@Nullable RailShape dir) { | ||
return (dir == RailShape.EAST_WEST || dir == RailShape.ASCENDING_EAST | ||
|| dir == RailShape.ASCENDING_WEST); | ||
public static boolean isNorthSouth(RailShape railShape) { | ||
return (railShape == RailShape.NORTH_SOUTH | ||
|| railShape == RailShape.ASCENDING_NORTH | ||
|| railShape == RailShape.ASCENDING_SOUTH); | ||
} | ||
|
||
public static boolean isNorthSouth(@Nullable RailShape dir) { | ||
return (dir == RailShape.NORTH_SOUTH || dir == RailShape.ASCENDING_NORTH | ||
|| dir == RailShape.ASCENDING_SOUTH); | ||
} | ||
|
||
public static boolean isAscending(@Nullable RailShape dir) { | ||
return dir != null && dir.isAscending(); | ||
} | ||
|
||
public static boolean isTurn(@Nullable RailShape dir) { | ||
return dir != null && dir.ordinal() >= 6; | ||
public static boolean isTurn(RailShape railShape) { | ||
return railShape == RailShape.SOUTH_EAST | ||
|| railShape == RailShape.SOUTH_WEST | ||
|| railShape == RailShape.NORTH_WEST | ||
|| railShape == RailShape.NORTH_EAST; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.