This commit is contained in:
CrazyDev22
2024-04-19 15:29:28 +02:00
parent a7118aa785
commit 79a4ebcf65

View File

@@ -118,11 +118,11 @@ public class MantleJigsawComponent extends IrisMantleComponent {
Position2 pos = new Position2(x, z); Position2 pos = new Position2(x, z);
for (String structure : distances.keySet()) { for (String structure : distances.keySet()) {
if (!cache.containsKey(structure)) continue; if (!cache.containsKey(structure)) continue;
double maxDist = distances.get(structure); double minDist = distances.get(structure);
maxDist = maxDist * maxDist; minDist = minDist * minDist;
for (Position2 sPos : cache.get(structure)) { for (Position2 sPos : cache.get(structure)) {
double dist = distanceCache.computeIfAbsent(sPos, position2 -> position2.distance(pos)); double dist = distanceCache.computeIfAbsent(sPos, position2 -> position2.distance(pos));
if (dist > maxDist) return true; if (minDist > dist) return true;
} }
} }
return false; return false;