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-27 23:07:57 -0500
committerGitHub <noreply@github.com>2022-03-28 00:07:57 -0400
commitf237ae4cecdfa5c00ee83bd0176a591a2b174913 (patch)
tree5b3e6d01296609b2a9f1701924e973b3bd19edd4 /src/main/java/io/github/moulberry/notenoughupdates/util/NEUDebugLogger.java
parent4afcd516ffc58d55da24c5f4db14db7922f61121 (diff)
downloadnotenoughupdates-f237ae4cecdfa5c00ee83bd0176a591a2b174913.tar.gz
notenoughupdates-f237ae4cecdfa5c00ee83bd0176a591a2b174913.tar.bz2
notenoughupdates-f237ae4cecdfa5c00ee83bd0176a591a2b174913.zip
Restore metal detector and wishing compass changes that were nuked by #94 (#104)
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.java10
1 files changed, 9 insertions, 1 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
index d662a872..827a3e97 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/NEUDebugLogger.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/NEUDebugLogger.java
@@ -13,6 +13,8 @@ import java.util.function.Consumer;
public class NEUDebugLogger {
private static final Minecraft mc = Minecraft.getMinecraft();
public static Consumer<String> logMethod = NEUDebugLogger::chatLogger;
+ // Used to prevent accessing NEUConfig in unit tests
+ public static boolean allFlagsEnabled = false;
private static void chatLogger(String message) {
mc.thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "[NEU DEBUG] " + message));
@@ -23,7 +25,13 @@ public class NEUDebugLogger {
}
public static void log(NEUDebugFlag flag, String message) {
- if (logMethod != null && isFlagEnabled(flag)) {
+ if (logMethod != null && (allFlagsEnabled || isFlagEnabled(flag))) {
+ logAlways(message);
+ }
+ }
+
+ public static void logAlways(String message) {
+ if (logMethod != null) {
logMethod.accept(message);
}
}