Class LevelStorageSource
java.lang.Object
net.minecraft.world.level.storage.LevelStorageSource
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordclass -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprivate final Pathprivate final Pathprivate static final intprivate final com.mojang.datafixers.DataFixerprivate static final org.slf4j.Loggerprivate static final PathMatcherstatic final Stringprivate final DirectoryValidator -
Constructor Summary
ConstructorsConstructorDescriptionLevelStorageSource(Path baseDir, Path backupDir, DirectoryValidator worldDirValidator, com.mojang.datafixers.DataFixer fixerUpper) -
Method Summary
Modifier and TypeMethodDescriptioncreateAccess(String levelId) static LevelStorageSourcecreateDefault(Path path) private static @Nullable InstantgetFileModificationTime(Path path) private static longstatic LevelDataAndDimensionsgetLevelDataAndDimensions(LevelStorageSource.LevelStorageAccess worldAccess, com.mojang.serialization.Dynamic<?> levelDataTag, WorldDataConfiguration dataConfiguration, Registry<LevelStem> datapackDimensions, HolderLookup.Provider registryAccess) getLevelPath(String levelId) getName()static WorldLoader.PackConfiggetPackConfig(com.mojang.serialization.Dynamic<?> levelDataTag, PackRepository packRepository, boolean safeMode) private intbooleanisNewLevelIdAcceptable(String levelId) booleanlevelExists(String levelId) Return whether the given world can be loaded.loadLevelSummaries(LevelStorageSource.LevelCandidates candidates) private LevelSummarymakeLevelSummary(com.mojang.serialization.Dynamic<?> dataTag, LevelStorageSource.LevelDirectory levelDirectory, boolean locked, int dataVersion) private static FeatureFlagSetparseFeatureFlagsFromSummary(com.mojang.serialization.Dynamic<?> tag) static DirectoryValidatorparseValidator(Path configPath) static WorldDataConfigurationreadDataConfig(com.mojang.serialization.Dynamic<?> levelData) static <T extends SavedData>
com.mojang.serialization.DataResult<T> readExistingSavedData(LevelStorageSource.LevelStorageAccess access, HolderLookup.Provider registryAccess, SavedDataType<T> savedDataType) private static CompoundTagreadLevelDataTagRaw(Path dataFile) private LevelSummaryreadLevelSummary(LevelStorageSource.LevelDirectory level, boolean locked) private static @Nullable TagreadLightweightData(Path dataFile) validateAndCreateAccess(String levelId) static voidwriteGameRules(WorldData worldData, Path worldFolder, GameRules gameRules)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TAG_DATA
- See Also:
-
NO_SYMLINKS_ALLOWED
-
ALLOWED_SYMLINKS_CONFIG_NAME
- See Also:
-
DISK_SPACE_WARNING_THRESHOLD
private static final int DISK_SPACE_WARNING_THRESHOLD- See Also:
-
baseDir
-
backupDir
-
fixerUpper
private final com.mojang.datafixers.DataFixer fixerUpper -
worldDirValidator
-
-
Constructor Details
-
LevelStorageSource
public LevelStorageSource(Path baseDir, Path backupDir, DirectoryValidator worldDirValidator, com.mojang.datafixers.DataFixer fixerUpper)
-
-
Method Details
-
parseValidator
-
createDefault
-
readDataConfig
-
getPackConfig
public static WorldLoader.PackConfig getPackConfig(com.mojang.serialization.Dynamic<?> levelDataTag, PackRepository packRepository, boolean safeMode) -
getLevelDataAndDimensions
public static LevelDataAndDimensions getLevelDataAndDimensions(LevelStorageSource.LevelStorageAccess worldAccess, com.mojang.serialization.Dynamic<?> levelDataTag, WorldDataConfiguration dataConfiguration, Registry<LevelStem> datapackDimensions, HolderLookup.Provider registryAccess) -
readExistingSavedData
public static <T extends SavedData> com.mojang.serialization.DataResult<T> readExistingSavedData(LevelStorageSource.LevelStorageAccess access, HolderLookup.Provider registryAccess, SavedDataType<T> savedDataType) -
writeGameRules
public static void writeGameRules(WorldData worldData, Path worldFolder, GameRules gameRules) throws IOException - Throws:
IOException
-
getName
-
findLevelCandidates
- Throws:
LevelStorageException
-
loadLevelSummaries
public CompletableFuture<List<LevelSummary>> loadLevelSummaries(LevelStorageSource.LevelCandidates candidates) -
getStorageVersion
private int getStorageVersion() -
readLevelDataTagRaw
- Throws:
IOException
-
readLevelSummary
-
getFileModificationTime
-
getFileModificationTime
-
makeLevelSummary
private LevelSummary makeLevelSummary(com.mojang.serialization.Dynamic<?> dataTag, LevelStorageSource.LevelDirectory levelDirectory, boolean locked, int dataVersion) -
parseFeatureFlagsFromSummary
-
readLightweightData
- Throws:
IOException
-
isNewLevelIdAcceptable
-
levelExists
Return whether the given world can be loaded. -
getLevelPath
-
getBaseDir
-
getBackupPath
-
validateAndCreateAccess
public LevelStorageSource.LevelStorageAccess validateAndCreateAccess(String levelId) throws IOException, ContentValidationException -
createAccess
- Throws:
IOException
-
getWorldDirValidator
-