logger fix

This commit is contained in:
MCRcortex
2025-11-20 17:34:12 +10:00
parent 9d8ade88f3
commit b688dc38d6

View File

@@ -53,6 +53,11 @@ public class Logger {
String error = (INSERT_CLASS?("["+callClsName()+"]: "):"") + Stream.of(args).map(Logger::objToString).collect(Collectors.joining(" ")); String error = (INSERT_CLASS?("["+callClsName()+"]: "):"") + Stream.of(args).map(Logger::objToString).collect(Collectors.joining(" "));
LOGGER.error(error, throwable); LOGGER.error(error, throwable);
if (VoxyCommon.IS_IN_MINECRAFT && !VoxyCommon.IS_DEDICATED_SERVER) { if (VoxyCommon.IS_IN_MINECRAFT && !VoxyCommon.IS_DEDICATED_SERVER) {
error0(error);//This is done so that on dedicated server, the Minecraft client class isnt loaded
}
}
private static void error0(String error) {
var instance = Minecraft.getInstance(); var instance = Minecraft.getInstance();
if (instance != null) { if (instance != null) {
instance.executeIfPossible(() -> { instance.executeIfPossible(() -> {
@@ -61,7 +66,6 @@ public class Logger {
}); });
} }
} }
}
public static void warn(Object... args) { public static void warn(Object... args) {
if (SHUTUP) { if (SHUTUP) {