Class PathUtil
java.lang.Object
com.blamejared.crafttweaker.api.util.PathUtil
Holds various utilities related to
Path manipulation.
Game directory in this context refers to the directory in which the game is set to be loaded. This means the directory containing mods, logs, and scripts.
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic PathfindFromGameDirectory(String other) Resolves the given path from the current game directory.static PathfindFromGameDirectory(Path other) Resolves the given path from the current game directory.static PathChanges the given path to be relative to the current game directory.static PathmakeRelativeToGameDirectory(Path other) Changes the given path to be relative to the current game directory.static PathmakeSameFileSystemPath(Path original, String other) Creates a new path with the same underlyingFileSystemas the specified one.
-
Method Details
-
findFromGameDirectory
Resolves the given path from the current game directory.The given string is automatically converted into a path with the same
FileSystemas the game directory.- Parameters:
other- The path to resolve- Returns:
- A new
Pathresolving according to the given rules. - Since:
- 10.0.0
- See Also:
-
findFromGameDirectory
Resolves the given path from the current game directory.- Parameters:
other- The path to resolve- Returns:
- A new
Pathresolving according to the given rules. - Since:
- 10.0.0
- See Also:
-
makeRelativeToGameDirectory
Changes the given path to be relative to the current game directory.The given string is automatically converted into a path with the same
FileSystemas the game directory.- Parameters:
other- The path to make relative.- Returns:
- A new relative
Path. - Since:
- 10.0.0
- See Also:
-
makeRelativeToGameDirectory
Changes the given path to be relative to the current game directory.- Parameters:
other- The path to make relative.- Returns:
- A new relative
Path. - Since:
- 10.0.0
- See Also:
-
makeSameFileSystemPath
Creates a new path with the same underlyingFileSystemas the specified one.- Parameters:
original- The path of which the file system should be obtained.other- The path to create in the file system.- Returns:
- A new
Pathpointing tootherwith the same FS asoriginal. - Since:
- 10.0.0
- See Also:
-