Class FileFixerUpper
java.lang.Object
net.minecraft.util.filefix.FileFixerUpper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final record -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFileFixerUpper(com.mojang.datafixers.DataFixerBuilder.Result dataFixer, List<FileFix> fileFixes, int latestFileFixerVersion) -
Method Summary
Modifier and TypeMethodDescriptionprivate static com.mojang.serialization.Dynamic<?> addVersionsToLevelData(com.mojang.serialization.Dynamic<?> fixed, int toVersion) voidapplyFileFixers(UpgradeProgress upgradeProgress, int loadedVersion, int toVersion, Path basePath) applyFileFixersOnCow(UpgradeProgress upgradeProgress, int loadedVersion, int toVersion, Path worldFolder, Path fileFixDirectory, Path tempWorld) private static voidprivate voidcountFiles(List<FileFix> applicableFixers, UpgradeProgress upgradeProgress) private static voiddeleteDirectory(Path directory) static FileSystemCapabilitiescom.mojang.serialization.Dynamic<?> fix(LevelStorageSource.LevelStorageAccess worldAccess, com.mojang.serialization.Dynamic<?> levelDataTag, UpgradeProgress upgradeProgress) com.mojang.serialization.Dynamic<?> fix(LevelStorageSource.LevelStorageAccess worldAccess, com.mojang.serialization.Dynamic<?> levelDataTag, UpgradeProgress upgradeProgress, int toVersion) getApplicableFixers(int fromVersion, int toVersion) booleanrequiresFileFixing(int levelDataVersion) startOrContinueFileFixing(UpgradeProgress upgradeProgress, int toVersion, Path worldFolder, Path tempWorld, Path fileFixDirectory, int loadedVersion) private static booleansupportsAtomicMove(Path dir) private static booleansupportsHardLinks(Path dir) protected static voidswapInFixedWorld(LevelStorageSource.LevelStorageAccess worldAccess, List<FileMove> moves, Path fileFixDirectory, Path tempWorld) static intworldVersionToFileFixerVersion(int levelDataVersion) private static voidprivate voidwriteUpdatedLevelData(Path worldFolder, int toVersion)
-
Field Details
-
FILE_FIXER_INTRODUCTION_VERSION
private static final int FILE_FIXER_INTRODUCTION_VERSION- See Also:
-
GSON
-
FILE_FIX_DIRECTORY_NAME
- See Also:
-
NEW_WORLD_TEMP_NAME
- See Also:
-
UPGRADE_IN_PROGRESS_NAME
- See Also:
-
LOGGER
private static final org.slf4j.Logger LOGGER -
dataFixer
private final com.mojang.datafixers.DataFixerBuilder.Result dataFixer -
fileFixes
-
latestFileFixerVersion
private final int latestFileFixerVersion
-
-
Constructor Details
-
FileFixerUpper
-
-
Method Details
-
worldVersionToFileFixerVersion
public static int worldVersionToFileFixerVersion(int levelDataVersion) -
requiresFileFixing
public boolean requiresFileFixing(int levelDataVersion) -
fix
public com.mojang.serialization.Dynamic<?> fix(LevelStorageSource.LevelStorageAccess worldAccess, com.mojang.serialization.Dynamic<?> levelDataTag, UpgradeProgress upgradeProgress) throws FileFixException - Throws:
FileFixException
-
fix
public com.mojang.serialization.Dynamic<?> fix(LevelStorageSource.LevelStorageAccess worldAccess, com.mojang.serialization.Dynamic<?> levelDataTag, UpgradeProgress upgradeProgress, int toVersion) throws FileFixException - Throws:
FileFixException
-
startOrContinueFileFixing
-
deleteDirectory
- Throws:
IOException
-
cleanup
-
applyFileFixersOnCow
private List<FileMove> applyFileFixersOnCow(UpgradeProgress upgradeProgress, int loadedVersion, int toVersion, Path worldFolder, Path fileFixDirectory, Path tempWorld) throws IOException - Throws:
IOException
-
applyFileFixers
public void applyFileFixers(UpgradeProgress upgradeProgress, int loadedVersion, int toVersion, Path basePath) throws IOException - Throws:
IOException
-
getApplicableFixers
-
countFiles
-
writeUpdatedLevelData
- Throws:
IOException
-
addVersionsToLevelData
private static com.mojang.serialization.Dynamic<?> addVersionsToLevelData(com.mojang.serialization.Dynamic<?> fixed, int toVersion) -
swapInFixedWorld
protected static void swapInFixedWorld(LevelStorageSource.LevelStorageAccess worldAccess, List<FileMove> moves, Path fileFixDirectory, Path tempWorld) throws FileFixException - Throws:
FileFixException
-
writeMoves
private static void writeMoves(List<FileMove> moves, Path fromDirectory, Path toDirectory, Path filePath) throws IOException - Throws:
IOException
-
readMoves
private static List<FileMove> readMoves(Path fromDirectory, Path toDirectory, Path filePath) throws IOException - Throws:
IOException
-
detectFileSystemCapabilities
- Throws:
IOException
-
supportsAtomicMove
- Throws:
IOException
-
supportsHardLinks
- Throws:
IOException
-