diff options
author | Luck <git@lucko.me> | 2020-06-23 12:27:34 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2020-06-23 12:27:34 +0100 |
commit | 85561633292550209a1461347f8446b54552b391 (patch) | |
tree | c5bf09a6a0a1bb0324f8e14ecda790184a183c2c /spark-bungeecord/src | |
parent | a2af3f8f7e3693f3e445d2998938bf448d47c35f (diff) | |
download | spark-85561633292550209a1461347f8446b54552b391.tar.gz spark-85561633292550209a1461347f8446b54552b391.tar.bz2 spark-85561633292550209a1461347f8446b54552b391.zip |
Add n-cpus and heap usage to platform info
Diffstat (limited to 'spark-bungeecord/src')
-rw-r--r-- | spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlatformInfo.java | 12 | ||||
-rw-r--r-- | spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordSparkPlugin.java | 4 |
2 files changed, 11 insertions, 5 deletions
diff --git a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlatformInfo.java b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlatformInfo.java index 91a64c4..67cb17c 100644 --- a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlatformInfo.java +++ b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordPlatformInfo.java @@ -20,10 +20,16 @@ package me.lucko.spark.bungeecord; -import me.lucko.spark.common.PlatformInfo; +import me.lucko.spark.common.platform.AbstractPlatformInfo; import net.md_5.bungee.api.ProxyServer; -public class BungeeCordPlatformInfo implements PlatformInfo { +public class BungeeCordPlatformInfo extends AbstractPlatformInfo { + private final ProxyServer proxy; + + public BungeeCordPlatformInfo(ProxyServer proxy) { + this.proxy = proxy; + } + @Override public Type getType() { return Type.PROXY; @@ -36,7 +42,7 @@ public class BungeeCordPlatformInfo implements PlatformInfo { @Override public String getVersion() { - return ProxyServer.getInstance().getVersion(); + return this.proxy.getVersion(); } @Override diff --git a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordSparkPlugin.java b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordSparkPlugin.java index ca02c14..5a3ad23 100644 --- a/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordSparkPlugin.java +++ b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/BungeeCordSparkPlugin.java @@ -22,7 +22,7 @@ package me.lucko.spark.bungeecord; import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.SparkPlugin; -import me.lucko.spark.common.PlatformInfo; +import me.lucko.spark.common.platform.PlatformInfo; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.plugin.Command; import net.md_5.bungee.api.plugin.Plugin; @@ -77,7 +77,7 @@ public class BungeeCordSparkPlugin extends Plugin implements SparkPlugin { @Override public PlatformInfo getPlatformInfo() { - return new BungeeCordPlatformInfo(); + return new BungeeCordPlatformInfo(getProxy()); } private static final class SparkCommand extends Command implements TabExecutor { |