mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-01-12 19:30:47 +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<>();
|
||||
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()) {
|
||||
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 regionCenter = min.add(halfCell);
|
||||
|
||||
if (regionCenter.distanceSquared(center) <= increasedRadiusSquared)
|
||||
if (regionCenter.toLong().distanceSquared(center.toLong()) <= increasedRadiusSquared)
|
||||
regions.add(region);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user