Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest SpongeAPI release. Adds #58 #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mods/sponge/metrics-lite/pom.xml
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
<dependency>
<groupId>org.spongepowered</groupId>
<artifactId>spongeapi</artifactId>
<version>3.0.0</version>
<version>4.0.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
Original file line number Diff line number Diff line change
@@ -288,10 +288,8 @@ private void postPlugin(final boolean isPing) throws IOException {
// Server software specific section
String pluginName = plugin.getName();
boolean onlineMode = game.getServer().getOnlineMode(); // TRUE if online mode is enabled
String pluginVersion = plugin.getVersion();
// TODO no visible way to get MC version at the moment
// TODO added by game.getPlatform().getMinecraftVersion() -- impl in 2.1
String serverVersion = String.format("%s %s", "Sponge", game.getPlatform().getApi().getVersion());
String pluginVersion = plugin.getVersion().orElse("unknownVersion");
String serverVersion = String.format("%s %s (MC: %s)", "Sponge", game.getPlatform().getApi().getVersion(), game.getPlatform().getMinecraftVersion().getName());
int playersOnline = game.getServer().getOnlinePlayers().size();

// END server software specific section -- all code below does not use any code outside of this class / Java
2 changes: 1 addition & 1 deletion mods/sponge/metrics/pom.xml
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
<dependency>
<groupId>org.spongepowered</groupId>
<artifactId>spongeapi</artifactId>
<version>3.0.0</version>
<version>4.0.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
6 changes: 2 additions & 4 deletions mods/sponge/metrics/src/main/java/org/mcstats/Metrics.java
Original file line number Diff line number Diff line change
@@ -336,10 +336,8 @@ private void postPlugin(final boolean isPing) throws IOException {
// Server software specific section
String pluginName = plugin.getName();
boolean onlineMode = game.getServer().getOnlineMode(); // TRUE if online mode is enabled
String pluginVersion = plugin.getVersion();
// TODO no visible way to get MC version at the moment
// TODO added by game.getPlatform().getMinecraftVersion() -- impl in 2.1
String serverVersion = String.format("%s %s", "Sponge", game.getPlatform().getApi().getVersion());
String pluginVersion = plugin.getVersion().orElse("unknownVersion");
String serverVersion = String.format("%s %s (MC: %s)", "Sponge", game.getPlatform().getApi().getVersion(), game.getPlatform().getMinecraftVersion().getName());
int playersOnline = game.getServer().getOnlinePlayers().size();

// END server software specific section -- all code below does not use any code outside of this class / Java