Package fr.rodofire.ewc.util.file
Class FileUtil
java.lang.Object
fr.rodofire.ewc.util.file.FileUtil
class that provide useful methods for files related.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PathgetLegacyGeneratedChunkDir(net.minecraft.world.level.chunk.ChunkAccess chunk, net.minecraft.world.level.WorldGenLevel world) method to get the path of the chunk under the generated folderstatic PathgetWorldSavePathDirectory(net.minecraft.world.level.WorldGenLevel world, net.minecraft.world.level.storage.LevelResource savePath) static Stringstatic voidremoveFile(Path path) method to remove a file without the risk of gettingFileNotFoundExceptionstatic voidremoveGeneratedChunkDirectory(net.minecraft.world.level.chunk.ChunkAccess chunk, net.minecraft.world.level.WorldGenLevel world) method to remove the chunk folder under the generated folderstatic voidrenameFile(Path oldPath, Path newPath) Method to move a file from one place to another.
-
Constructor Details
-
FileUtil
public FileUtil()
-
-
Method Details
-
renameFile
Method to move a file from one place to another.
If the old path and the new path are under the same folder, this will just rename the file
- Parameters:
oldPath- the path of the file that will be movednewPath- the path of the new file
-
removeFile
method to remove a file without the risk of gettingFileNotFoundException- Parameters:
path- the path of the file
-
getLegacyGeneratedChunkDir
public static Path getLegacyGeneratedChunkDir(net.minecraft.world.level.chunk.ChunkAccess chunk, net.minecraft.world.level.WorldGenLevel world) method to get the path of the chunk under the generated folder- Parameters:
chunk- the chunk of the folderworld- the world used to get the generated folder- Returns:
- the path
-
removeGeneratedChunkDirectory
public static void removeGeneratedChunkDirectory(net.minecraft.world.level.chunk.ChunkAccess chunk, net.minecraft.world.level.WorldGenLevel world) method to remove the chunk folder under the generated folder- Parameters:
chunk- the chunk of the folder that will be removedworld- the world used to get the generated folder
-
getWorldSavePathDirectory
public static Path getWorldSavePathDirectory(net.minecraft.world.level.WorldGenLevel world, net.minecraft.world.level.storage.LevelResource savePath) -
loadJson
-