Skip to content

Commit 2fcc2fe

Browse files
committed
use mathutil for square calls
1 parent daceeb0 commit 2fcc2fe

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

shared/src/main/java/me/xginko/aef/utils/ChunkUtil.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import org.bukkit.Chunk;
55
import org.bukkit.Location;
66
import org.bukkit.Material;
7-
import org.bukkit.util.NumberConversions;
87

98
public final class ChunkUtil {
109

@@ -56,17 +55,17 @@ public static void setLayerOf(Material material, int y, Chunk chunk) {
5655
}
5756

5857
public static double getChunkDistanceSquared(Chunk chunk1, Chunk chunk2) {
59-
return NumberConversions.square(chunk1.getX() - chunk2.getX()) +
60-
NumberConversions.square(chunk1.getZ() - chunk2.getZ());
58+
return MathUtil.square(chunk1.getX() - chunk2.getX()) +
59+
MathUtil.square(chunk1.getZ() - chunk2.getZ());
6160
}
6261

6362
public static double getChunkDistanceSquared(Chunk chunk, Location location) {
64-
return NumberConversions.square(chunk.getX() - (location.getBlockX() >> 4)) +
65-
NumberConversions.square(chunk.getZ() - (location.getBlockZ() >> 4));
63+
return MathUtil.square(chunk.getX() - (location.getBlockX() >> 4)) +
64+
MathUtil.square(chunk.getZ() - (location.getBlockZ() >> 4));
6665
}
6766

6867
public static double getChunkDistanceSquared(Location location1, Location location2) {
69-
return NumberConversions.square((location1.getBlockX() >> 4) - (location2.getBlockX() >> 4)) +
70-
NumberConversions.square((location1.getBlockZ() >> 4) - (location2.getBlockZ() >> 4));
68+
return MathUtil.square((location1.getBlockX() >> 4) - (location2.getBlockX() >> 4)) +
69+
MathUtil.square((location1.getBlockZ() >> 4) - (location2.getBlockZ() >> 4));
7170
}
7271
}

0 commit comments

Comments
 (0)