diff options
| author | jani270 <69345714+jani270@users.noreply.github.com> | 2024-04-30 06:37:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-30 14:37:59 +1000 |
| commit | 7e5bcda8fde6719562247c1f233985ac07d9f560 (patch) | |
| tree | 8c146cbbb4bc8282411b25a3b4d876dc7a01e50b /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java | |
| parent | cc454c394f44f3dd1029ed7943e043cbe569ae0f (diff) | |
| download | notenoughupdates-7e5bcda8fde6719562247c1f233985ac07d9f560.tar.gz notenoughupdates-7e5bcda8fde6719562247c1f233985ac07d9f560.tar.bz2 notenoughupdates-7e5bcda8fde6719562247c1f233985ac07d9f560.zip | |
Add Titles to the Metal Detector Solver (#1136)
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 | 23 |
1 files changed, 23 insertions, 0 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 e355c437..a78a28f4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java @@ -25,6 +25,8 @@ import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; import io.github.moulberry.notenoughupdates.options.customtypes.NEUDebugFlag; import io.github.moulberry.notenoughupdates.util.NEUDebugLogger; import io.github.moulberry.notenoughupdates.util.SBInfo; +import io.github.moulberry.notenoughupdates.util.SpecialColour; +import io.github.moulberry.notenoughupdates.util.TitleUtil; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.entity.item.EntityArmorStand; @@ -165,6 +167,11 @@ public class CrystalMetalDetectorSolver { // falls through case FOUND: Utils.addChatMessage(EnumChatFormatting.YELLOW + "[NEU] Found solution."); + metalDetectorTitle( + "Found Solution", + NotEnoughUpdates.INSTANCE.config.mining.metalDetectorTicks, + NotEnoughUpdates.INSTANCE.config.mining.metalDetectorFoundColor + ); if (NEUDebugFlag.METAL.isSet() && (previousState == SolutionState.INVALID || previousState == SolutionState.FAILED)) { NEUDebugLogger.log( @@ -181,6 +188,11 @@ public class CrystalMetalDetectorSolver { break; case FAILED: Utils.addChatMessage(EnumChatFormatting.RED + "[NEU] Failed to find a solution."); + metalDetectorTitle( + "Failed to find a solution!", + NotEnoughUpdates.INSTANCE.config.mining.metalDetectorTicks, + NotEnoughUpdates.INSTANCE.config.mining.metalDetectorFailedColor + ); logDiagnosticData(false); resetSolution(false); break; @@ -191,6 +203,11 @@ public class CrystalMetalDetectorSolver { Utils.addChatMessage( EnumChatFormatting.YELLOW + "[NEU] Need another position to find solution. Possible blocks: " + possibleBlocks.size()); + metalDetectorTitle( + "Need another position!", + NotEnoughUpdates.INSTANCE.config.mining.metalDetectorTicks, + NotEnoughUpdates.INSTANCE.config.mining.metalDetectorMoveColor + ); break; default: throw new IllegalStateException("Metal detector is in invalid state"); @@ -198,6 +215,12 @@ public class CrystalMetalDetectorSolver { } } + private static void metalDetectorTitle(String title, int ticks, String color) { + if (NotEnoughUpdates.INSTANCE.config.mining.metalDetectorTitle) { + TitleUtil.getInstance().createTitle(title, ticks, SpecialColour.specialToChromaRGB(color)); + } + } + static void findPossibleSolutions(double distToTreasure, Vec3Comparable playerPos, boolean centerNewlyDiscovered) { if (Math.abs(prevDistToTreasure - distToTreasure) < 0.2 && prevPlayerPos.distanceTo(playerPos) <= 0.1 && |
