Skip to content

Commit 1c554f3

Browse files
committed
near_chunks now return Coord without block deltas
1 parent 6eab4f8 commit 1c554f3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: minenbt/utils.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,13 @@ def near_chunks(x, z, distance) -> List[Coord]:
6060
"""Return an list of Coord, from nearest to farthest, one Coord for every chunck.
6161
Every returned Coord has a distance from `(x,z)` lesser than `distance`."""
6262
start = Coord(x, 0, z)
63-
block_delta = start.block()
6463
results = []
6564
region_range = floor(distance / 512) + 1
6665
for rx in range(-region_range, region_range + 1):
6766
for rz in range(-region_range, region_range + 1):
68-
for cx in range(0, 32):
69-
for cz in range(0, 32):
70-
point = Coord.compose((rx, rz), (cx, cz), 0, block_delta)
67+
for cx in range(0, 16):
68+
for cz in range(0, 16):
69+
point = Coord.compose((rx, rz), (cx, cz), 0)
7170
results.append((point, start.distance(point)))
7271
results = sorted(results, key=lambda k: k[1])
7372
results = results[: bisect.bisect_right([r[1] for r in results], distance)]

0 commit comments

Comments
 (0)