aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2022-10-23 13:33:15 +0200
committerGitHub <noreply@github.com>2022-10-23 13:33:15 +0200
commitdd6a4011a95da0481b98ff472dedc7911f9a3741 (patch)
treec526a50c3dd178cc55b6d92529e6c89d265dc0ce /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java
parenta2e1983b47392d7724df78f842ef81bfb6f67d60 (diff)
downloadnotenoughupdates-dd6a4011a95da0481b98ff472dedc7911f9a3741.tar.gz
notenoughupdates-dd6a4011a95da0481b98ff472dedc7911f9a3741.tar.bz2
notenoughupdates-dd6a4011a95da0481b98ff472dedc7911f9a3741.zip
Minion Helper (#254)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Co-authored-by: ThexXTURBOXx <nico.mexis@kabelmail.de> Co-authored-by: efefury <69400149+efefury@users.noreply.github.com>
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.java26
1 files changed, 12 insertions, 14 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 ab9345cb..23115c36 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java
@@ -25,10 +25,10 @@ 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.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.util.BlockPos;
-import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.Vec3i;
@@ -169,7 +169,7 @@ public class CrystalMetalDetectorSolver {
NEUDebugLogger.log(NEUDebugFlag.METAL, "Known location identified.");
// falls through
case FOUND:
- mc.thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "[NEU] Found solution."));
+ Utils.addChatMessage(EnumChatFormatting.YELLOW + "[NEU] Found solution.");
if (NEUDebugFlag.METAL.isSet() &&
(previousState == SolutionState.INVALID || previousState == SolutionState.FAILED)) {
NEUDebugLogger.log(
@@ -180,14 +180,12 @@ public class CrystalMetalDetectorSolver {
}
break;
case INVALID:
- mc.thePlayer.addChatMessage(new ChatComponentText(
- EnumChatFormatting.RED + "[NEU] Previous solution is invalid."));
+ Utils.addChatMessage(EnumChatFormatting.RED + "[NEU] Previous solution is invalid.");
logDiagnosticData(false);
resetSolution(false);
break;
case FAILED:
- mc.thePlayer.addChatMessage(new ChatComponentText(
- EnumChatFormatting.RED + "[NEU] Failed to find a solution."));
+ Utils.addChatMessage(EnumChatFormatting.RED + "[NEU] Failed to find a solution.");
logDiagnosticData(false);
resetSolution(false);
break;
@@ -195,8 +193,9 @@ public class CrystalMetalDetectorSolver {
NEUDebugLogger.log(NEUDebugFlag.METAL, "Multiple known locations identified:");
// falls through
case MULTIPLE:
- mc.thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW +
- "[NEU] Need another position to find solution. Possible blocks: " + possibleBlocks.size()));
+ Utils.addChatMessage(
+ EnumChatFormatting.YELLOW + "[NEU] Need another position to find solution. Possible blocks: " +
+ possibleBlocks.size());
break;
default:
throw new IllegalStateException("Metal detector is in invalid state");
@@ -372,8 +371,8 @@ public class CrystalMetalDetectorSolver {
if (keeperEntities.size() == 0) {
if (!visitKeeperMessagePrinted) {
- mc.thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW +
- "[NEU] Approach a Keeper while holding the metal detector to enable faster treasure hunting."));
+ Utils.addChatMessage(EnumChatFormatting.YELLOW +
+ "[NEU] Approach a Keeper while holding the metal detector to enable faster treasure hunting.");
visitKeeperMessagePrinted = true;
}
return false;
@@ -387,8 +386,8 @@ public class CrystalMetalDetectorSolver {
minesCenter = keeperEntity.getPosition().add(keeperOffsets.get(keeperType.toLowerCase()));
NEUDebugLogger.log(NEUDebugFlag.METAL, "Mines center: " +
EnumChatFormatting.WHITE + minesCenter.toString());
- mc.thePlayer.addChatMessage(new ChatComponentText(
- EnumChatFormatting.YELLOW + "[NEU] Faster treasure hunting is now enabled based on Keeper location."));
+ Utils.addChatMessage(
+ EnumChatFormatting.YELLOW + "[NEU] Faster treasure hunting is now enabled based on Keeper location.");
return true;
}
@@ -560,8 +559,7 @@ public class CrystalMetalDetectorSolver {
}
if (!NotEnoughUpdates.INSTANCE.config.mining.metalDetectorEnabled) {
- mc.thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED +
- "[NEU] Metal Detector Solver is not enabled."));
+ Utils.addChatMessage(EnumChatFormatting.RED + "[NEU] Metal Detector Solver is not enabled.");
return;
}