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-24 14:55:20 -0500
committerGitHub <noreply@github.com>2022-03-24 19:55:20 +0000
commite202e4adf979073921455083f5e737bc4fcf5f14 (patch)
tree5e1653b8696168294f2b3456d532e88d4a73fc73 /src/main/java/io/github/moulberry/notenoughupdates/util/NEUDebugLogger.java
parent7d923e6675dc681261e3cbd5fb0c81263209dbc6 (diff)
downloadnotenoughupdates-e202e4adf979073921455083f5e737bc4fcf5f14.tar.gz
notenoughupdates-e202e4adf979073921455083f5e737bc4fcf5f14.tar.bz2
notenoughupdates-e202e4adf979073921455083f5e737bc4fcf5f14.zip
Refactor Hollows solvers, add tests, add Vec3Comparable, fix bugs (#95)
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);
}
}