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 int(package private) final com.mojang.datafixers.DataFixer(package private) static final DateTimeFormatter(package private) static final org.slf4j.Loggerprivate static final PathMatcherstatic final Stringprivate static final intprivate final DirectoryValidator -
Constructor Summary
ConstructorsConstructorDescriptionLevelStorageSource(Path pBaseDir, Path pBackupDir, DirectoryValidator pWorldDirValidator, com.mojang.datafixers.DataFixer pFixerUpper) -
Method Summary
Modifier and TypeMethodDescriptioncreateAccess(String pSaveName) static LevelStorageSourcecreateDefault(Path pSavesDir) (package private) static InstantgetFileModificationTime(Path pDataFilePath) private static longgetFileModificationTime(LevelStorageSource.LevelDirectory pLevelDirectory) static LevelDataAndDimensionsgetLevelDataAndDimensions(com.mojang.serialization.Dynamic<?> pLevelData, WorldDataConfiguration pDataConfiguration, Registry<LevelStem> pLevelStemRegistry, HolderLookup.Provider pRegistries) getLevelPath(String pSaveName) getName()static WorldLoader.PackConfiggetPackConfig(com.mojang.serialization.Dynamic<?> pDynamic, PackRepository pPackRepository, boolean pSafeMode) private intbooleanisNewLevelIdAcceptable(String pSaveName) booleanlevelExists(String pSaveName) Return whether the given world can be loaded.loadLevelSummaries(LevelStorageSource.LevelCandidates pCandidates) (package private) LevelSummarymakeLevelSummary(com.mojang.serialization.Dynamic<?> pDynamic, LevelStorageSource.LevelDirectory pLevelDirectory, boolean pLocked) private static FeatureFlagSetparseFeatureFlagsFromSummary(com.mojang.serialization.Dynamic<?> pDataDynamic) static DirectoryValidatorparseValidator(Path pValidator) static WorldDataConfigurationreadDataConfig(com.mojang.serialization.Dynamic<?> pDynamic) (package private) static com.mojang.serialization.Dynamic<?> readLevelDataTagFixed(Path pLevelPath, com.mojang.datafixers.DataFixer pDataFixer) (package private) static CompoundTagreadLevelDataTagRaw(Path pLevelPath) private LevelSummaryreadLevelSummary(LevelStorageSource.LevelDirectory pLevelDirectory, boolean pLocked) private static TagreadLightweightData(Path pFile) validateAndCreateAccess(String pSaveName)
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER -
FORMATTER
-
TAG_DATA
- See Also:
-
NO_SYMLINKS_ALLOWED
-
ALLOWED_SYMLINKS_CONFIG_NAME
- See Also:
-
UNCOMPRESSED_NBT_QUOTA
private static final int UNCOMPRESSED_NBT_QUOTA- See Also:
-
DISK_SPACE_WARNING_THRESHOLD
private static final int DISK_SPACE_WARNING_THRESHOLD- See Also:
-
baseDir
-
backupDir
-
fixerUpper
final com.mojang.datafixers.DataFixer fixerUpper -
worldDirValidator
-
-
Constructor Details
-
LevelStorageSource
public LevelStorageSource(Path pBaseDir, Path pBackupDir, DirectoryValidator pWorldDirValidator, com.mojang.datafixers.DataFixer pFixerUpper)
-
-
Method Details
-
parseValidator
-
createDefault
-
readDataConfig
-
getPackConfig
public static WorldLoader.PackConfig getPackConfig(com.mojang.serialization.Dynamic<?> pDynamic, PackRepository pPackRepository, boolean pSafeMode) -
getLevelDataAndDimensions
public static LevelDataAndDimensions getLevelDataAndDimensions(com.mojang.serialization.Dynamic<?> pLevelData, WorldDataConfiguration pDataConfiguration, Registry<LevelStem> pLevelStemRegistry, HolderLookup.Provider pRegistries) -
getName
-
findLevelCandidates
- Throws:
LevelStorageException
-
loadLevelSummaries
public CompletableFuture<List<LevelSummary>> loadLevelSummaries(LevelStorageSource.LevelCandidates pCandidates) -
getStorageVersion
private int getStorageVersion() -
readLevelDataTagRaw
- Throws:
IOException
-
readLevelDataTagFixed
static com.mojang.serialization.Dynamic<?> readLevelDataTagFixed(Path pLevelPath, com.mojang.datafixers.DataFixer pDataFixer) throws IOException - Throws:
IOException
-
readLevelSummary
private LevelSummary readLevelSummary(LevelStorageSource.LevelDirectory pLevelDirectory, boolean pLocked) -
getFileModificationTime
-
getFileModificationTime
-
makeLevelSummary
LevelSummary makeLevelSummary(com.mojang.serialization.Dynamic<?> pDynamic, LevelStorageSource.LevelDirectory pLevelDirectory, boolean pLocked) -
parseFeatureFlagsFromSummary
private static FeatureFlagSet parseFeatureFlagsFromSummary(com.mojang.serialization.Dynamic<?> pDataDynamic) -
readLightweightData
- Throws:
IOException
-
isNewLevelIdAcceptable
-
levelExists
Return whether the given world can be loaded. -
getLevelPath
-
getBaseDir
-
getBackupPath
-
validateAndCreateAccess
public LevelStorageSource.LevelStorageAccess validateAndCreateAccess(String pSaveName) throws IOException, ContentValidationException -
createAccess
- Throws:
IOException
-
getWorldDirValidator
-