public class WorldSaveRepresents a world. Note: Fields are marked nullable to prevent NullPointerExceptions, although Minecraft usually generates default Nbt Structures when loading a World.
Constructors
public WorldSave(Path worldDirectory)| Parameters | ||
|---|---|---|
worldDirectory | Path | |
Methods
Optional<CustomBossEvents> getCustomBossEvents()Optional<GameRules> getGameRules()Level getLevel()Returns the level value.SessionLock getLock()Returns the lock value.List<Player> getPlayers()Returns the players value.Optional<RandomSequences> getRandomSequences()Optional<Scoreboard> getScoreboard()Optional<StopWatches> getStopWatches()Optional<WanderingTrader> getWanderingTrader()Optional<Weather> getWeather()Optional<WorldClocks> getWorldClocks()Path getWorldDirectory()Returns the worldDirectory value.Optional<WorldGenSettings> getWorldGenSettings()void save()Writes whatever changed since loading (or the last save): level.dat, data/minecraft and the players.public Optional<CustomBossEvents> getCustomBossEvents()| Returns | ||
|---|---|---|
Optional<CustomBossEvents> | ||
public Optional<GameRules> getGameRules()getLevel()
lombokSource
public Level getLevel()public SessionLock getLock()getPlayers()
lombokSource
public List<Player> getPlayers()public Optional<RandomSequences> getRandomSequences()| Returns | ||
|---|---|---|
Optional<RandomSequences> | ||
public Optional<Scoreboard> getScoreboard()| Returns | ||
|---|---|---|
Optional<Scoreboard> | ||
public Optional<StopWatches> getStopWatches()| Returns | ||
|---|---|---|
Optional<StopWatches> | ||
public Optional<WanderingTrader> getWanderingTrader()| Returns | ||
|---|---|---|
Optional<WanderingTrader> | ||
public Optional<Weather> getWeather()public Optional<WorldClocks> getWorldClocks()| Returns | ||
|---|---|---|
Optional<WorldClocks> | ||
public Path getWorldDirectory()Returns the worldDirectory value.
| Returns | ||
|---|---|---|
Path | ||
Generated by Lombok's @Getter for the field worldDirectory
public Optional<WorldGenSettings> getWorldGenSettings()| Returns | ||
|---|---|---|
Optional<WorldGenSettings> | ||
public void save() throws IOExceptionWrites whatever changed since loading (or the last save): level.dat, data/minecraft and the players.
level.dat and the player files keep a .dat_old, like Minecraft does. Chunks go through
Dimension.saveChunkData instead| Throws | ||
|---|---|---|
IOException | If writing fails, or Minecraft has the world open right now | |