aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2022-05-05 21:14:51 +0100
committerLuck <git@lucko.me>2022-05-05 21:14:51 +0100
commit0e8cd0b07083c9535fbb007eb06f50b06cdc4bf0 (patch)
tree7923a61ccfbaf3264939fbc73eadc36aa67219c0 /spark-common/src/main/java/me
parentc1bf08cd76f4ddee97a530f9ab4ffa613b6f27f1 (diff)
downloadspark-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.java6
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();
}