Skip to content

Commit

Permalink
existing chunk positions
Browse files Browse the repository at this point in the history
  • Loading branch information
Faithcaio committed Oct 5, 2023
1 parent 7ecd0a8 commit fd0b714
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/org/spongepowered/api/world/server/ServerWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import java.util.Objects;
import java.util.Optional;
import java.util.UUID;
import java.util.stream.Stream;

public interface ServerWorld extends World<ServerWorld, ServerLocation>, Identifiable, InteractableVolume,
ServerLocationCreator, WeatherUniverse.Mutable {
Expand Down Expand Up @@ -235,4 +236,15 @@ default boolean restoreSnapshot(final Vector3i position, final BlockSnapshot sna
*/
ChunkManager chunkManager();

/**
* Returns a stream of existing chunk positions for this world.
* <p>
* Note that consuming the stream may be slow.
* The stream must be closed or fully consumed otherwise file handles may stay open.
* </p>
*
* @return The stream of existing chunk positions.
*/
Stream<Vector3i> chunkPositions();

}

0 comments on commit fd0b714

Please sign in to comment.