diff options
| author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2021-08-19 18:24:35 +0200 |
|---|---|---|
| committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2021-08-19 18:24:35 +0200 |
| commit | d525edf7b6395250feefb8b930d7234574721aba (patch) | |
| tree | 777d69abbf54f89337ba488fa13ff7e482b34693 /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java | |
| parent | daf03820a63662b3024e1722a587c8fffd694b3b (diff) | |
| download | notenoughupdates-d525edf7b6395250feefb8b930d7234574721aba.tar.gz notenoughupdates-d525edf7b6395250feefb8b930d7234574721aba.tar.bz2 notenoughupdates-d525edf7b6395250feefb8b930d7234574721aba.zip | |
config options
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java | 8 |
1 files changed, 5 insertions, 3 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 24496593..b95675bc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java @@ -1,5 +1,6 @@ package io.github.moulberry.notenoughupdates.miscfeatures; +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; import io.github.moulberry.notenoughupdates.util.SBInfo; import net.minecraft.client.Minecraft; @@ -19,12 +20,13 @@ public class CrystalMetalDetectorSolver { if (SBInfo.getInstance().getLocation() != null && SBInfo.getInstance().getLocation().equals("crystal_hollows") && message.getUnformattedText().contains("TREASURE: ")) { float dist = Float.parseFloat(message.getUnformattedText().split("TREASURE: ")[1].split("m")[0].replaceAll("(?!\\.)\\D", "")); - if (prevDist == dist && prevPos.getX() == mc.thePlayer.getPosition().getX() && prevPos.getY() == mc.thePlayer.getPosition().getY() && + if (NotEnoughUpdates.INSTANCE.config.mining.metalDetectorEnabled && prevDist == dist && prevPos.getX() == mc.thePlayer.getPosition().getX() && + prevPos.getY() == mc.thePlayer.getPosition().getY() && prevPos.getZ() == mc.thePlayer.getPosition().getZ() && !locations.contains(mc.thePlayer.getPosition())) { if (possibleBlocks.size() == 0) { locations.add(mc.thePlayer.getPosition()); for (int zOffset = (int) Math.floor(-dist); zOffset <= Math.ceil(dist); zOffset++) { - for (int yOffset = 65; yOffset <= 70; yOffset++) { + for (int yOffset = 65; yOffset <= 75; yOffset++) { float calculatedDist = 0; int xOffset = 0; while (calculatedDist < dist) { @@ -91,7 +93,7 @@ public class CrystalMetalDetectorSolver { if (SBInfo.getInstance().getLocation() != null && SBInfo.getInstance().getLocation().equals("crystal_hollows")) { if (possibleBlocks.size() == 1) { RenderUtils.renderWayPoint("Treasure", possibleBlocks.get(0).add(0, 2.5, 0), partialTicks); - } else { + } else if(possibleBlocks.size() > 1 && NotEnoughUpdates.INSTANCE.config.mining.metalDetectorShowPossible) { for (BlockPos block : possibleBlocks) { RenderUtils.renderWayPoint("Possible Treasure Location", block.add(0, 2.5, 0), partialTicks); } |
