diff --git a/src/main/kotlin/org/polyfrost/polyplus/client/features/JvmAdvisor.kt b/src/main/kotlin/org/polyfrost/polyplus/client/features/JvmAdvisor.kt index 9d31b861..a8628e86 100644 --- a/src/main/kotlin/org/polyfrost/polyplus/client/features/JvmAdvisor.kt +++ b/src/main/kotlin/org/polyfrost/polyplus/client/features/JvmAdvisor.kt @@ -219,11 +219,20 @@ object JvmAdvisor { } private fun report() { - val advice = runCatching { evaluate(snapshot()) } - .onFailure { logger.warn("Could not evaluate JVM memory advice", it) } - .getOrNull() ?: return - logger.info("JVM advice: {}", advice.message) + Thread({ + val advice = runCatching { evaluate(snapshot()) } + .onFailure { logger.warn("Could not evaluate JVM memory advice", it) } + .getOrNull() ?: return@Thread + logger.info("JVM advice: {}", advice.message) + //? if > 1.8.9 { + Minecraft.getInstance().execute { showAdvice(advice) } + //?} else { + /*Minecraft.getInstance().tell { showAdvice(advice) } + *///?} + }, "polyplus-jvm-advisor").apply { isDaemon = true }.start() + } + private fun showAdvice(advice: Advice) { if (!PolyPlusConfig.ramAdviceNotifications) return val now = System.currentTimeMillis() if (now - PolyPlusConfig.jvmAdviceShownAt < ADVICE_INTERVAL_MS) return