diff options
author | olim <bobq4582@gmail.com> | 2024-04-17 15:04:10 +0100 |
---|---|---|
committer | olim <bobq4582@gmail.com> | 2024-04-17 15:04:10 +0100 |
commit | c04bef8c93f15ba162091db40c6062af47d22515 (patch) | |
tree | c6a6fe3dc1660d17cd013f9db0eb4133ef199fbb /src/main/java/de/hysky/skyblocker | |
parent | 31744be3393f3fcec57dccfbc4aa8a1942c08f15 (diff) | |
download | Skyblocker-c04bef8c93f15ba162091db40c6062af47d22515.tar.gz Skyblocker-c04bef8c93f15ba162091db40c6062af47d22515.tar.bz2 Skyblocker-c04bef8c93f15ba162091db40c6062af47d22515.zip |
add tests
Diffstat (limited to 'src/main/java/de/hysky/skyblocker')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetector.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetector.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetector.java index 203e1880..e302b778 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetector.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetector.java @@ -81,14 +81,14 @@ public class MetalDetector { new Vec3i(-37, -21, -22) // -37, -21, -22 )); - private static Vec3i minesCenter = null; + protected static Vec3i minesCenter = null; private static double previousDistance; private static Vec3d previousPlayerPos; - private static boolean newTreasure = true; + protected static boolean newTreasure = true; private static boolean startedLooking = false; - private static List<Vec3i> possibleBlocks = new ArrayList<>(); + protected static List<Vec3i> possibleBlocks = new ArrayList<>(); public static void init() { ClientReceiveMessageEvents.GAME.register(MetalDetector::getDistanceMessage); @@ -151,7 +151,7 @@ public class MetalDetector { } } - private static void updatePossibleBlocks(Double distance, Vec3d playerPos) { + protected static void updatePossibleBlocks(Double distance, Vec3d playerPos) { if (newTreasure) { possibleBlocks = new ArrayList<>(); newTreasure = false; @@ -164,8 +164,8 @@ public class MetalDetector { } } else { - for (int x = -distance.intValue(); x < distance; x++) { - for (int z = -distance.intValue(); z < distance; z++) { + for (int x = -distance.intValue(); x <= distance; x++) { + for (int z = -distance.intValue(); z <= distance; z++) { Vec3i checkPos =new Vec3i((int)(playerPos.x) + x, (int)playerPos.y, (int)playerPos.z + z); if (Math.abs(playerPos.distanceTo(Vec3d.of(checkPos)) - distance) < 0.25) { possibleBlocks.add(checkPos); |