We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6600281 commit 5068c65Copy full SHA for 5068c65
1 file changed
src/Oneblock/IslandCoordinateCalculator.java
@@ -14,10 +14,24 @@ public static int findNearestRegionId(Location loc) {
14
15
int halfStoSquared = (Oneblock.offset / 2) * (Oneblock.offset / 2);
16
17
+ int X = 0, Z = 0;
18
+
19
for (int i = 0; i < size; i++) {
- int[] coord = Oneblock.plugin.getIslandCoordinates(i);
- int dx = coord[0] - locX;
20
- int dz = coord[1] - locZ;
+ if (!Oneblock.CircleMode) {
21
+ if (X > Z)
22
+ if (X > -Z)
23
+ Z--;
24
+ else
25
+ X--;
26
+ else if (-X > Z || X == Z && Z < 0)
27
+ Z++;
28
29
+ X++;
30
+ }
31
+ else X = i;
32
33
+ int dx = (X * Oneblock.offset + Oneblock.x) - locX;
34
+ int dz = (Z * Oneblock.offset + Oneblock.z) - locZ;
35
int distSq = dx * dx + dz * dz;
36
37
if (distSq < minDistSq) {
0 commit comments