Skip to content

Commit

Permalink
Return to ServerWorld#saveAndFlush() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Lignium committed Jun 17, 2023
1 parent 031359c commit aed2fca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 56 deletions.
44 changes: 0 additions & 44 deletions src/main/java/org/spongepowered/api/world/WorldSaveMode.java

This file was deleted.

19 changes: 7 additions & 12 deletions src/main/java/org/spongepowered/api/world/server/ServerWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.spongepowered.api.world.BlockChangeFlag;
import org.spongepowered.api.world.SerializationBehavior;
import org.spongepowered.api.world.World;
import org.spongepowered.api.world.WorldSaveMode;
import org.spongepowered.api.world.WorldType;
import org.spongepowered.api.world.WorldTypes;
import org.spongepowered.api.world.chunk.WorldChunk;
Expand Down Expand Up @@ -184,29 +183,25 @@ default boolean restoreSnapshot(final Vector3i position, final BlockSnapshot sna
Path directory();

/**
* Instructs the world to save all data with
* {@link WorldSaveMode#SAVE the default save mode}.
* Instructs the world to save all data.
*
* @return True if save was successful, or false if
* {@link SerializationBehavior} is {@link SerializationBehavior#NONE}
* @throws IOException If the save failed
* @deprecated Use {@link ServerWorld#save(WorldSaveMode)}
* @see ServerWorld#save(WorldSaveMode)
* @see ServerWorld#saveAndFlush()
*/
@Deprecated
default boolean save() throws IOException {
return save(WorldSaveMode.SAVE);
}
boolean save() throws IOException;

/**
* Instructs the world to save all data with the specified save mode.
* Instructs the world to save and flush all data immediately.
*
* <p>Note: May cause a short-term drop in server performance</p>
*
* @param saveMode The save mode
* @return True if save was successful, or false if
* {@link SerializationBehavior} is {@link SerializationBehavior#NONE}
* @throws IOException If the save failed
*/
boolean save(WorldSaveMode saveMode) throws IOException;
boolean saveAndFlush() throws IOException;

/**
* Unloads the given chunk from the world. Returns a {@code boolean} flag
Expand Down

0 comments on commit aed2fca

Please sign in to comment.