diff options
author | Luck <git@lucko.me> | 2022-12-10 09:54:20 +0000 |
---|---|---|
committer | Luck <git@lucko.me> | 2022-12-10 09:54:20 +0000 |
commit | 1536537473aa5dead4c7353444e217df30d2ad96 (patch) | |
tree | 9d2c83fe1285f843ce8145d92fa2f037b86828ac /spark-common/src/main/java/me/lucko/spark/common/sampler | |
parent | 81326e7bd3b038c2e47cc418262fa4caaad50b48 (diff) | |
download | spark-1536537473aa5dead4c7353444e217df30d2ad96.tar.gz spark-1536537473aa5dead4c7353444e217df30d2ad96.tar.bz2 spark-1536537473aa5dead4c7353444e217df30d2ad96.zip |
Never run the background profiler on MC clients
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common/sampler')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/sampler/BackgroundSamplerManager.java | 7 |
1 files changed, 3 insertions, 4 deletions
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() { |