mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-23 00:47:39 +01:00
Implement PlatformVersion for better dump output
This commit is contained in:
parent
68fc884d2a
commit
4142797380
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,13 @@ public interface ViaPlatform<T> {
|
||||
*/
|
||||
String getPlatformName();
|
||||
|
||||
/**
|
||||
* Get the platform version
|
||||
*
|
||||
* @return Platforn version
|
||||
*/
|
||||
String getPlatformVersion();
|
||||
|
||||
/**
|
||||
* Get the plugin version
|
||||
*
|
||||
|
@ -39,6 +39,7 @@ public class DumpSubCmd extends ViaSubCommand {
|
||||
ProtocolRegistry.SERVER_PROTOCOL,
|
||||
ProtocolRegistry.getSupportedVersions(),
|
||||
Via.getPlatform().getPlatformName(),
|
||||
Via.getPlatform().getPlatformVersion(),
|
||||
Via.getPlatform().getPluginVersion()
|
||||
);
|
||||
|
||||
|
@ -14,5 +14,6 @@ public class VersionInfo {
|
||||
private Set<Integer> enabledProtocols;
|
||||
private String platformName;
|
||||
private String platformVersion;
|
||||
private String pluginVersion;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user