aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2021-08-19 12:55:35 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2021-08-19 12:55:35 +0200
commit3a1d5603de6e6e80adc80fa5535be1b05912d1f0 (patch)
tree57a32c51f871ee16b8d9534a0cf347856b982537 /src
parent9c1e2163350c3a2eea843deda5c13d42594d85b0 (diff)
downloadNotEnoughUpdates-3a1d5603de6e6e80adc80fa5535be1b05912d1f0.tar.gz
NotEnoughUpdates-3a1d5603de6e6e80adc80fa5535be1b05912d1f0.tar.bz2
NotEnoughUpdates-3a1d5603de6e6e80adc80fa5535be1b05912d1f0.zip
moulBeFix
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java4
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));
}
}