diff options
author | Luck <git@lucko.me> | 2022-05-05 21:14:51 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2022-05-05 21:14:51 +0100 |
commit | 0e8cd0b07083c9535fbb007eb06f50b06cdc4bf0 (patch) | |
tree | 7923a61ccfbaf3264939fbc73eadc36aa67219c0 /spark-common/src/main/java/me | |
parent | c1bf08cd76f4ddee97a530f9ab4ffa613b6f27f1 (diff) | |
download | spark-0e8cd0b07083c9535fbb007eb06f50b06cdc4bf0.tar.gz spark-0e8cd0b07083c9535fbb007eb06f50b06cdc4bf0.tar.bz2 spark-0e8cd0b07083c9535fbb007eb06f50b06cdc4bf0.zip |
Include player count in platform statistics
Diffstat (limited to 'spark-common/src/main/java/me')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java b/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java index 046def7..f35bbbe 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java +++ b/spark-common/src/main/java/me/lucko/spark/common/platform/PlatformStatisticsProvider.java @@ -176,6 +176,12 @@ public class PlatformStatisticsProvider { ); } + PlatformInfo.Type platformType = this.platform.getPlugin().getPlatformInfo().getType(); + if (platformType != PlatformInfo.Type.CLIENT) { + long playerCount = this.platform.getPlugin().getCommandSenders().count() - 1; // includes console + builder.setPlayerCount(playerCount); + } + return builder.build(); } |