Class LevelStorageSource
java.lang.Object
net.minecraft.world.level.storage.LevelStorageSource
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static final record
class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
private final Path
private final Path
private static final int
(package private) final com.mojang.datafixers.DataFixer
(package private) static final DateTimeFormatter
(package private) static final org.slf4j.Logger
private static final PathMatcher
private static final String
private static final int
private final DirectoryValidator
-
Constructor Summary
ConstructorsConstructorDescriptionLevelStorageSource
(Path baseDir, Path backupDir, DirectoryValidator worldDirValidator, com.mojang.datafixers.DataFixer fixerUpper) -
Method Summary
Modifier and TypeMethodDescriptioncreateAccess
(String saveName) static LevelStorageSource
createDefault
(Path savesDir) (package private) static Instant
getFileModificationTime
(Path dataFilePath) private static long
getFileModificationTime
(LevelStorageSource.LevelDirectory levelDirectory) static LevelDataAndDimensions
getLevelDataAndDimensions
(com.mojang.serialization.Dynamic<?> p_dynamic, WorldDataConfiguration dataConfiguration, Registry<LevelStem> levelStemRegistry, RegistryAccess.Frozen registry) getLevelPath
(String saveName) getName()
static WorldLoader.PackConfig
getPackConfig
(com.mojang.serialization.Dynamic<?> dynamic, PackRepository packRepository, boolean safeMode) private int
boolean
isNewLevelIdAcceptable
(String saveName) boolean
levelExists
(String saveName) Return whether the given world can be loaded.loadLevelSummaries
(LevelStorageSource.LevelCandidates candidates) (package private) LevelSummary
makeLevelSummary
(com.mojang.serialization.Dynamic<?> dynamic, LevelStorageSource.LevelDirectory levelDirectory, boolean locked) private static FeatureFlagSet
parseFeatureFlagsFromSummary
(com.mojang.serialization.Dynamic<?> dataDynamic) static DirectoryValidator
parseValidator
(Path validator) static WorldDataConfiguration
readDataConfig
(com.mojang.serialization.Dynamic<?> dynamic) (package private) static com.mojang.serialization.Dynamic
<?> readLevelDataTagFixed
(Path levelPath, com.mojang.datafixers.DataFixer dataFixer) (package private) static CompoundTag
readLevelDataTagRaw
(Path levelPath) private LevelSummary
readLevelSummary
(LevelStorageSource.LevelDirectory levelDirectory, boolean locked) private static Tag
readLightweightData
(Path file) validateAndCreateAccess
(String saveName)
-
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 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<?> dynamic, PackRepository packRepository, boolean safeMode) -
getLevelDataAndDimensions
public static LevelDataAndDimensions getLevelDataAndDimensions(com.mojang.serialization.Dynamic<?> p_dynamic, WorldDataConfiguration dataConfiguration, Registry<LevelStem> levelStemRegistry, RegistryAccess.Frozen registry) -
getName
-
findLevelCandidates
- Throws:
LevelStorageException
-
loadLevelSummaries
public CompletableFuture<List<LevelSummary>> loadLevelSummaries(LevelStorageSource.LevelCandidates candidates) -
getStorageVersion
private int getStorageVersion() -
readLevelDataTagRaw
- Throws:
IOException
-
readLevelDataTagFixed
static com.mojang.serialization.Dynamic<?> readLevelDataTagFixed(Path levelPath, com.mojang.datafixers.DataFixer dataFixer) throws IOException - Throws:
IOException
-
readLevelSummary
private LevelSummary readLevelSummary(LevelStorageSource.LevelDirectory levelDirectory, boolean locked) -
getFileModificationTime
-
getFileModificationTime
-
makeLevelSummary
LevelSummary makeLevelSummary(com.mojang.serialization.Dynamic<?> dynamic, LevelStorageSource.LevelDirectory levelDirectory, boolean locked) -
parseFeatureFlagsFromSummary
private static FeatureFlagSet parseFeatureFlagsFromSummary(com.mojang.serialization.Dynamic<?> dataDynamic) -
readLightweightData
- Throws:
IOException
-
isNewLevelIdAcceptable
-
levelExists
Return whether the given world can be loaded. -
getLevelPath
-
getBaseDir
-
getBackupPath
-
validateAndCreateAccess
public LevelStorageSource.LevelStorageAccess validateAndCreateAccess(String saveName) throws IOException, ContentValidationException -
createAccess
- Throws:
IOException
-
getWorldDirValidator
-