Skip to content

Commit

Permalink
Use inclusive IntStream for region bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
aromaa committed Oct 31, 2023
1 parent 1a62ba2 commit 7ca40ed
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ public ChunkManager chunkManager() {
RegionFile regionFile = new RegionFile(path, regionPath, true);
final Vector4i regionBound = this.api$pathToRegionPos(path);
// Find all chunks in bounds
final Stream<ChunkPos> chunkPosStream = IntStream.range(regionBound.x(), regionBound.z())
.mapToObj(x -> IntStream.range(regionBound.y(), regionBound.w()).
final Stream<ChunkPos> chunkPosStream = IntStream.rangeClosed(regionBound.x(), regionBound.z())
.mapToObj(x -> IntStream.rangeClosed(regionBound.y(), regionBound.w()).
mapToObj(z -> new ChunkPos(x, z)))
.flatMap(Function.identity());
return mapper.apply(regionFile, chunkPosStream).onClose(() -> this.api$close(regionFile));
Expand Down

0 comments on commit 7ca40ed

Please sign in to comment.