Class LevelStorage
java.lang.Object
net.minecraft.world.level.storage.LevelStorage
public class LevelStorage extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classLevelStorage.Session -
Field Summary
Fields Modifier and Type Field Description private PathbackupsDirectoryprivate com.mojang.datafixers.DataFixerdataFixerprivate static ImmutableList<String>GENERATOR_OPTION_KEYSprivate static LoggerLOGGERprivate PathsavesDirectoryprivate static DateTimeFormatterTIME_FORMATTER -
Constructor Summary
Constructors Constructor Description LevelStorage(Path savesDirectory, Path backupsDirectory, com.mojang.datafixers.DataFixer dataFixer) -
Method Summary
Modifier and Type Method Description static LevelStoragecreate(Path path)private static BiFunction<File,com.mojang.datafixers.DataFixer,LevelProperties>createLevelDataParser(com.mojang.serialization.DynamicOps<Tag> dynamicOps, DataPackSettings dataPackSettings)private BiFunction<File,com.mojang.datafixers.DataFixer,LevelSummary>createLevelDataParser(File file, boolean locked)LevelStorage.SessioncreateSession(String directoryName)PathgetBackupsDirectory()private intgetCurrentVersion()List<LevelSummary>getLevelList()PathgetSavesDirectory()booleanisLevelNameValid(String name)booleanlevelExists(String name)private static DataPackSettingsparseDataPackSettings(com.mojang.serialization.Dynamic<?> dynamic)private static DataPackSettingsreadDataPackSettings(File file, com.mojang.datafixers.DataFixer dataFixer)private static <T> com.mojang.datafixers.util.Pair<GeneratorOptions,com.mojang.serialization.Lifecycle>readGeneratorProperties(com.mojang.serialization.Dynamic<T> dynamic, com.mojang.datafixers.DataFixer dataFixer, int int2)private <T> TreadLevelProperties(File file, BiFunction<File,com.mojang.datafixers.DataFixer,T> levelDataParser)
-
Field Details
-
LOGGER
-
TIME_FORMATTER
-
GENERATOR_OPTION_KEYS
-
savesDirectory
-
backupsDirectory
-
dataFixer
private final com.mojang.datafixers.DataFixer dataFixer
-
-
Constructor Details
-
LevelStorage
-
-
Method Details
-
create
-
readGeneratorProperties
private static <T> com.mojang.datafixers.util.Pair<GeneratorOptions,com.mojang.serialization.Lifecycle> readGeneratorProperties(com.mojang.serialization.Dynamic<T> dynamic, com.mojang.datafixers.DataFixer dataFixer, int int2) -
parseDataPackSettings
-
getLevelList
-
getCurrentVersion
private int getCurrentVersion() -
readLevelProperties
@Nullable private <T> T readLevelProperties(File file, BiFunction<File,com.mojang.datafixers.DataFixer,T> levelDataParser) -
readDataPackSettings
@Nullable private static DataPackSettings readDataPackSettings(File file, com.mojang.datafixers.DataFixer dataFixer) -
createLevelDataParser
private static BiFunction<File,com.mojang.datafixers.DataFixer,LevelProperties> createLevelDataParser(com.mojang.serialization.DynamicOps<Tag> dynamicOps, DataPackSettings dataPackSettings) -
createLevelDataParser
private BiFunction<File,com.mojang.datafixers.DataFixer,LevelSummary> createLevelDataParser(File file, boolean locked) -
isLevelNameValid
-
levelExists
-
getSavesDirectory
-
getBackupsDirectory
-
createSession
- Throws:
IOException
-