fix stream limit. immutable's in BOML

This commit is contained in:
Wagyourtail
2022-12-27 22:42:38 -07:00
parent c04eb066cb
commit 98a748afb3
3 changed files with 29 additions and 13 deletions

View File

@@ -55,7 +55,11 @@ public enum FasterWorldScanner implements IWorldScanner {
@Override
public List<BlockPos> scanChunk(IPlayerContext ctx, BlockOptionalMetaLookup filter, ChunkPos pos, int max, int yLevelThreshold) {
return scanChunkInternal(ctx, filter, pos).limit(max).collect(Collectors.toList());
Stream<BlockPos> stream = scanChunkInternal(ctx, filter, pos);
if (max >= 0) {
stream = stream.limit(max);
}
return stream.collect(Collectors.toList());
}
@Override