aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/NEUDebugLogger.java
diff options
context:
space:
mode:
authorCraftyOldMiner <85420839+CraftyOldMiner@users.noreply.github.com>2022-03-07 21:44:17 -0600
committerGitHub <noreply@github.com>2022-03-07 22:44:17 -0500
commit73fad7064fb47d9d79ccdb3bab5988df1b9eea6f (patch)
tree8b192d2304de3823339f238653e6d55dcfdfd04a /src/main/java/io/github/moulberry/notenoughupdates/util/NEUDebugLogger.java
parent8b630cb7c39e73346d43b1e083b62b30fc3cde8f (diff)
downloadnotenoughupdates-73fad7064fb47d9d79ccdb3bab5988df1b9eea6f.tar.gz
notenoughupdates-73fad7064fb47d9d79ccdb3bab5988df1b9eea6f.tar.bz2
notenoughupdates-73fad7064fb47d9d79ccdb3bab5988df1b9eea6f.zip
Wishing Compass Solver, Metal Detector Solver improvements, add /neudiag, other misc changes (#90)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/NEUDebugLogger.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/NEUDebugLogger.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/NEUDebugLogger.java b/src/main/java/io/github/moulberry/notenoughupdates/util/NEUDebugLogger.java
new file mode 100644
index 00000000..d662a872
--- /dev/null
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/NEUDebugLogger.java
@@ -0,0 +1,30 @@
+package io.github.moulberry.notenoughupdates.util;
+
+import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
+import io.github.moulberry.notenoughupdates.options.customtypes.NEUDebugFlag;
+import net.minecraft.client.Minecraft;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
+
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.function.Consumer;
+
+public class NEUDebugLogger {
+ private static final Minecraft mc = Minecraft.getMinecraft();
+ public static Consumer<String> logMethod = NEUDebugLogger::chatLogger;
+
+ private static void chatLogger(String message) {
+ mc.thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "[NEU DEBUG] " + message));
+ }
+
+ public static boolean isFlagEnabled(NEUDebugFlag flag) {
+ return NotEnoughUpdates.INSTANCE.config.hidden.debugFlags.contains(flag);
+ }
+
+ public static void log(NEUDebugFlag flag, String message) {
+ if (logMethod != null && isFlagEnabled(flag)) {
+ logMethod.accept(message);
+ }
+ }
+}