public class LevelStorage extends Object
Modifier and Type | Class and Description |
---|---|
class |
LevelStorage.Session |
Modifier and Type | Field and Description |
---|---|
private Path |
backupsDirectory |
private com.mojang.datafixers.DataFixer |
dataFixer |
private static ImmutableList<String> |
GENERATOR_OPTION_KEYS |
private static Logger |
LOGGER |
private Path |
savesDirectory |
private static DateTimeFormatter |
TIME_FORMATTER |
Constructor and Description |
---|
LevelStorage(Path savesDirectory,
Path backupsDirectory,
com.mojang.datafixers.DataFixer dataFixer) |
Modifier and Type | Method and Description |
---|---|
static LevelStorage |
create(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.Session |
createSession(String directoryName) |
Path |
getBackupsDirectory() |
private int |
getCurrentVersion() |
List<LevelSummary> |
getLevelList() |
Path |
getSavesDirectory() |
boolean |
isLevelNameValid(String name) |
boolean |
levelExists(String name) |
private static DataPackSettings |
parseDataPackSettings(com.mojang.serialization.Dynamic<?> dynamic) |
private static DataPackSettings |
readDataPackSettings(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> T |
readLevelProperties(File file,
BiFunction<File,com.mojang.datafixers.DataFixer,T> levelDataParser) |
private static final Logger LOGGER
private static final DateTimeFormatter TIME_FORMATTER
private static final ImmutableList<String> GENERATOR_OPTION_KEYS
private final Path savesDirectory
private final Path backupsDirectory
private final com.mojang.datafixers.DataFixer dataFixer
public static LevelStorage create(Path path)
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 static DataPackSettings parseDataPackSettings(com.mojang.serialization.Dynamic<?> dynamic)
@Environment(value=CLIENT) public List<LevelSummary> getLevelList()
private int getCurrentVersion()
@Nullable private <T> T readLevelProperties(File file, BiFunction<File,com.mojang.datafixers.DataFixer,T> levelDataParser)
@Nullable private static DataPackSettings readDataPackSettings(File file, com.mojang.datafixers.DataFixer dataFixer)
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)
@Environment(value=CLIENT) public boolean isLevelNameValid(String name)
@Environment(value=CLIENT) public boolean levelExists(String name)
@Environment(value=CLIENT) public Path getSavesDirectory()
@Environment(value=CLIENT) public Path getBackupsDirectory()
public LevelStorage.Session createSession(String directoryName) throws IOException
IOException