mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-01-26 18:21:20 +01:00
Merge branch 'master' into feature/v2
This commit is contained in:
commit
a4ce85b9f8
@ -117,7 +117,7 @@ private static List<Vector2i> getRegions(BmMap map, Vector2i center, int radius)
|
|||||||
|
|
||||||
List<Vector2i> regions = new ArrayList<>();
|
List<Vector2i> regions = new ArrayList<>();
|
||||||
Vector2i halfCell = regionGrid.getGridSize().div(2);
|
Vector2i halfCell = regionGrid.getGridSize().div(2);
|
||||||
int increasedRadiusSquared = (int) Math.pow(radius + Math.ceil(halfCell.length()), 2);
|
long increasedRadiusSquared = (long) Math.pow(radius + Math.ceil(halfCell.length()), 2);
|
||||||
|
|
||||||
for (Vector2i region : world.listRegions()) {
|
for (Vector2i region : world.listRegions()) {
|
||||||
if (!regionFilter.test(region)) continue;
|
if (!regionFilter.test(region)) continue;
|
||||||
@ -125,7 +125,7 @@ private static List<Vector2i> getRegions(BmMap map, Vector2i center, int radius)
|
|||||||
Vector2i min = regionGrid.getCellMin(region);
|
Vector2i min = regionGrid.getCellMin(region);
|
||||||
Vector2i regionCenter = min.add(halfCell);
|
Vector2i regionCenter = min.add(halfCell);
|
||||||
|
|
||||||
if (regionCenter.distanceSquared(center) <= increasedRadiusSquared)
|
if (regionCenter.toLong().distanceSquared(center.toLong()) <= increasedRadiusSquared)
|
||||||
regions.add(region);
|
regions.add(region);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user