From 1536537473aa5dead4c7353444e217df30d2ad96 Mon Sep 17 00:00:00 2001 From: Luck Date: Sat, 10 Dec 2022 09:54:20 +0000 Subject: Never run the background profiler on MC clients --- .../me/lucko/spark/common/sampler/BackgroundSamplerManager.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'spark-common/src/main/java/me/lucko/spark/common/sampler') diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/BackgroundSamplerManager.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/BackgroundSamplerManager.java index d655739..7e3b6b4 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/sampler/BackgroundSamplerManager.java +++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/BackgroundSamplerManager.java @@ -41,10 +41,9 @@ public class BackgroundSamplerManager { public BackgroundSamplerManager(SparkPlatform platform, Configuration configuration) { this.platform = platform; this.configuration = configuration; - this.enabled = this.configuration.getBoolean( - OPTION_ENABLED, - this.platform.getPlugin().getPlatformInfo().getType() == PlatformInfo.Type.SERVER - ); + + PlatformInfo.Type type = this.platform.getPlugin().getPlatformInfo().getType(); + this.enabled = type != PlatformInfo.Type.CLIENT && this.configuration.getBoolean(OPTION_ENABLED, type == PlatformInfo.Type.SERVER); } public void initialise() { -- cgit