Implement PlatformVersion for better dump output

This commit is contained in:
Matsv 2016-11-13 12:36:48 +01:00
parent 68fc884d2a
commit 4142797380
6 changed files with 25 additions and 1 deletions

View File

@ -141,6 +141,11 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaPlatform {
@Override
public String getPlatformName() {
return Bukkit.getServer().getName();
}
@Override
public String getPlatformVersion() {
return Bukkit.getServer().getVersion();
}

View File

@ -56,6 +56,11 @@ public class BungeePlugin extends Plugin implements ViaPlatform, Listener {
@Override
public String getPlatformName() {
return getProxy().getName();
}
@Override
public String getPlatformVersion() {
return getProxy().getVersion();
}

View File

@ -29,6 +29,13 @@ public interface ViaPlatform<T> {
*/
String getPlatformName();
/**
* Get the platform version
*
* @return Platforn version
*/
String getPlatformVersion();
/**
* Get the plugin version
*

View File

@ -39,6 +39,7 @@ public class DumpSubCmd extends ViaSubCommand {
ProtocolRegistry.SERVER_PROTOCOL,
ProtocolRegistry.getSupportedVersions(),
Via.getPlatform().getPlatformName(),
Via.getPlatform().getPlatformVersion(),
Via.getPlatform().getPluginVersion()
);

View File

@ -14,5 +14,6 @@ public class VersionInfo {
private Set<Integer> enabledProtocols;
private String platformName;
private String platformVersion;
private String pluginVersion;
}

View File

@ -86,7 +86,12 @@ public class SpongePlugin implements ViaPlatform {
@Override
public String getPlatformName() {
return "Sponge";
return game.getPlatform().getApi().getName();
}
@Override
public String getPlatformVersion() {
return game.getPlatform().getApi().getId();
}
@Override