diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2021-08-19 12:55:35 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2021-08-19 12:55:35 +0200 |
commit | 3a1d5603de6e6e80adc80fa5535be1b05912d1f0 (patch) | |
tree | 57a32c51f871ee16b8d9534a0cf347856b982537 /src/main/java/io | |
parent | 9c1e2163350c3a2eea843deda5c13d42594d85b0 (diff) | |
download | NotEnoughUpdates-3a1d5603de6e6e80adc80fa5535be1b05912d1f0.tar.gz NotEnoughUpdates-3a1d5603de6e6e80adc80fa5535be1b05912d1f0.tar.bz2 NotEnoughUpdates-3a1d5603de6e6e80adc80fa5535be1b05912d1f0.zip |
moulBeFix
Diffstat (limited to 'src/main/java/io')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java index f30a792c..ae6a2f5c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java @@ -23,7 +23,7 @@ public class CrystalMetalDetectorSolver { prevPos.getZ() == mc.thePlayer.getPosition().getZ() && !locations.contains(mc.thePlayer.getPosition())) { if (possibleBlocks.size() == 0) { locations.add(mc.thePlayer.getPosition()); - for (int zOffset = Math.round(-dist); zOffset <= dist; zOffset++) { + for (int zOffset = (int) Math.floor(-dist); zOffset <= Math.ceil(dist); zOffset++) { for (int yOffset = 65; yOffset <= 69; yOffset++) { float calculatedDist = 0; int xOffset = 0; @@ -120,6 +120,6 @@ public class CrystalMetalDetectorSolver { } private static float calculateDistance(Vec3 pos1, Vec3 pos2) { - return (float) Math.sqrt(Math.pow(pos2.xCoord - pos1.xCoord, 2) + Math.pow(pos2.yCoord - pos1.yCoord, 2) + Math.pow(pos2.zCoord - pos1.zCoord, 2)); + return (float) Math.sqrt(Math.pow(pos2.xCoord - pos1.xCoord, 2) + pos2.yCoord - pos1.yCoord + Math.pow(pos2.zCoord - pos1.zCoord, 2)); } } |