public class LevelStorage.Session extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
private Path |
directory |
private String |
directoryName |
private SessionLock |
lock |
private Map<WorldSavePath,Path> |
paths |
Modifier and Type | Method and Description |
---|---|
void |
backupLevelDataFile(DynamicRegistryManager dynamicRegistryManager,
SaveProperties saveProperties) |
void |
backupLevelDataFile(DynamicRegistryManager dynamicRegistryManager,
SaveProperties saveProperties,
CompoundTag compoundTag) |
private void |
checkValid() |
void |
close() |
boolean |
convert(ProgressListener progressListener) |
long |
createBackup() |
WorldSaveHandler |
createSaveHandler() |
void |
deleteSessionLock() |
DataPackSettings |
getDataPackSettings() |
Path |
getDirectory(WorldSavePath savePath) |
String |
getDirectoryName() |
File |
getIconFile() |
LevelSummary |
getLevelSummary() |
File |
getWorldDirectory(RegistryKey<World> key) |
boolean |
needsConversion() |
SaveProperties |
readLevelProperties(com.mojang.serialization.DynamicOps<Tag> dynamicOps,
DataPackSettings dataPackSettings) |
void |
save(String name) |
private final SessionLock lock
private final Path directory
private final String directoryName
private final Map<WorldSavePath,Path> paths
public Session(String directoryName) throws IOException
IOException
public String getDirectoryName()
public Path getDirectory(WorldSavePath savePath)
public File getWorldDirectory(RegistryKey<World> key)
private void checkValid()
public WorldSaveHandler createSaveHandler()
public boolean needsConversion()
public boolean convert(ProgressListener progressListener)
@Nullable public LevelSummary getLevelSummary()
@Nullable public SaveProperties readLevelProperties(com.mojang.serialization.DynamicOps<Tag> dynamicOps, DataPackSettings dataPackSettings)
@Nullable public DataPackSettings getDataPackSettings()
public void backupLevelDataFile(DynamicRegistryManager dynamicRegistryManager, SaveProperties saveProperties)
public void backupLevelDataFile(DynamicRegistryManager dynamicRegistryManager, SaveProperties saveProperties, @Nullable CompoundTag compoundTag)
public File getIconFile()
@Environment(value=CLIENT) public void deleteSessionLock() throws IOException
IOException
@Environment(value=CLIENT) public void save(String name) throws IOException
IOException
@Environment(value=CLIENT) public long createBackup() throws IOException
IOException
public void close() throws IOException
close
in interface AutoCloseable
IOException