aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetector.java33
-rw-r--r--src/main/resources/assets/skyblocker/lang/en_us.json4
-rw-r--r--src/test/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetectorTest.java2
3 files changed, 19 insertions, 20 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 9a1ad53d..31dced3b 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetector.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetector.java
@@ -17,8 +17,9 @@ import net.minecraft.util.math.Box;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vec3i;
-import java.awt.*;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -92,10 +93,10 @@ public class MetalDetector {
}
/**
- * process
- * when a message with the distance to the treasure is sent to the player and then update the helper and workout possible locations using that message
- * @param text message sent
- * @param overlay if its to the overlay
+ * Processes the message with the distance to the treasure, updates the helper, and works out possible locations using that message.
+ *
+ * @param text the message sent to the player
+ * @param overlay if the message is an overlay message
*/
private static void getDistanceMessage(Text text, boolean overlay) {
if (!overlay || !SkyblockerConfigManager.get().locations.dwarvenMines.metalDetectorHelper || !Utils.isInCrystalHollows() || !(Utils.getIslandArea().substring(2).equals("Mines of Divan")) || CLIENT.player == null) {
@@ -143,8 +144,9 @@ public class MetalDetector {
}
/**
- * reset when if message is sent saying the player found the treasure
- * @param text message sent to player
+ * Processes the found treasure message and resets the helper
+ *
+ * @param text the message sent to the player
*/
private static void checkChestFound(Text text) {
if (!Utils.isInCrystalHollows() || !(Utils.getIslandArea().substring(2).equals("Mines of Divan")) || CLIENT.player == null) {
@@ -157,11 +159,12 @@ public class MetalDetector {
}
/**
- * using the distance the treasure is from the player work out blocks that are that far away and narrows down possible locations until there is one left
- * @param distance how far the treasure is from the player
- * @param playerPos where the player is
+ * Works out the possible locations the treasure could be using the distance the treasure is from the player and
+ * narrows down possible locations until there is one left.
+ *
+ * @param distance the distance the treasure is from the player squared
+ * @param playerPos the position of the player
*/
-
protected static void updatePossibleBlocks(double distance, Vec3d playerPos) {
if (newTreasure) {
possibleBlocks = new ArrayList<>();
@@ -198,9 +201,8 @@ public class MetalDetector {
}
/**
- * uses the labels for the keepers names to find the central point of the mines of divan so the known offsets can be used
+ * Uses the labels for the keepers names to find the central point of the mines of divan so the known offsets can be used.
*/
-
private static void findCenterOfMines() {
if (CLIENT.player == null || CLIENT.world == null) {
return;
@@ -222,10 +224,9 @@ public class MetalDetector {
}
/**
- * renders waypoints for the location of treasure / possible treasure
+ * Renders waypoints for the location of treasure or possible treasure.
* @param context world render context
*/
-
private static void render(WorldRenderContext context) {
//only render enabled and if there is a few location options and in the mines of divan
if (!SkyblockerConfigManager.get().locations.dwarvenMines.metalDetectorHelper || !Utils.isInCrystalHollows() || possibleBlocks.isEmpty() || possibleBlocks.size() > 8 || !(Utils.getIslandArea().substring(2).equals("Mines of Divan"))) {
diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json
index 7b42ee39..42f0f505 100644
--- a/src/main/resources/assets/skyblocker/lang/en_us.json
+++ b/src/main/resources/assets/skyblocker/lang/en_us.json
@@ -517,8 +517,8 @@
"skyblocker.exotic.glitched": "GLITCHED",
"skyblocker.exotic.exotic": "EXOTIC",
- "skyblocker.dwarvenMines.metalDetectorHelper.startTip": "Stand still in multiple places unit solver has narrowed down locations to one",
- "skyblocker.dwarvenMines.metalDetectorHelper.foundCenter": "Found center of mines now working faster",
+ "skyblocker.dwarvenMines.metalDetectorHelper.startTip": "Stand still in multiple places until the solver has narrowed down possible locations to one",
+ "skyblocker.dwarvenMines.metalDetectorHelper.foundCenter": "Found the center of mines, now working faster",
"skyblocker.dwarvenMines.metalDetectorHelper.foundTreasureMessage": "Found treasure",
"skyblocker.dwarvenMines.metalDetectorHelper.possibleTreasureLocationsMessage": "Possible treasure locations: ",
"skyblocker.dwarvenMines.metalDetectorHelper.somethingWentWrongMessage": "Something went wrong with the metal detector. Trying again",
diff --git a/src/test/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetectorTest.java b/src/test/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetectorTest.java
index 22532f96..2566c88a 100644
--- a/src/test/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetectorTest.java
+++ b/src/test/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetectorTest.java
@@ -8,7 +8,6 @@ import org.junit.jupiter.api.Test;
import java.util.ArrayList;
public class MetalDetectorTest {
-
@Test
void testFindPossibleBlocks() {
//test starting without knowing middle
@@ -29,6 +28,5 @@ public class MetalDetectorTest {
MetalDetector.updatePossibleBlocks(24.9, new Vec3d(10, 1, 10));
Assertions.assertEquals(MetalDetector.possibleBlocks.size(), 1);
Assertions.assertEquals(MetalDetector.possibleBlocks.get(0), new Vec3i(1, -20, 20));
-
}
}