From 921bfbae87df2b6e765e5abe182fbeb4b63aba79 Mon Sep 17 00:00:00 2001 From: Luck Date: Thu, 20 Sep 2018 14:59:34 +0100 Subject: [PATCH] Add missing getters to ServerPing and rename Modinfo --> ModInfo --- .../api/proxy/server/ServerPing.java | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java b/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java index bf9a3f2ee..f4fb7c1ae 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java @@ -16,13 +16,13 @@ public class ServerPing { private final Players players; private final Component description; private final @Nullable Favicon favicon; - private final Modinfo modinfo; + private final ModInfo modinfo; public ServerPing(Version version, @Nullable Players players, Component description, @Nullable Favicon favicon) { - this(version, players, description, favicon, Modinfo.DEFAULT); + this(version, players, description, favicon, ModInfo.DEFAULT); } - public ServerPing(Version version, @Nullable Players players, Component description, @Nullable Favicon favicon, @Nullable Modinfo modinfo) { + public ServerPing(Version version, @Nullable Players players, Component description, @Nullable Favicon favicon, ServerPing.@Nullable ModInfo modinfo) { this.version = Preconditions.checkNotNull(version, "version"); this.players = players; this.description = Preconditions.checkNotNull(description, "description"); @@ -46,7 +46,7 @@ public class ServerPing { return Optional.ofNullable(favicon); } - public Optional getModinfo() { + public Optional getModinfo() { return Optional.ofNullable(modinfo); } @@ -165,7 +165,7 @@ public class ServerPing { public ServerPing build() { return new ServerPing(version, nullOutPlayers ? null : new Players(onlinePlayers, maximumPlayers, samplePlayers), description, favicon, - nullOutModinfo ? null : new Modinfo(modType, mods)); + nullOutModinfo ? null : new ModInfo(modType, mods)); } public Version getVersion() { @@ -302,13 +302,13 @@ public class ServerPing { } } - public static class Modinfo { - public static final Modinfo DEFAULT = new Modinfo("FML", ImmutableList.of()); + public static class ModInfo { + public static final ModInfo DEFAULT = new ModInfo("FML", ImmutableList.of()); private final String type; private final List modList; - public Modinfo(String type, List modList) { + public ModInfo(String type, List modList) { this.type = Preconditions.checkNotNull(type, "type"); this.modList = ImmutableList.copyOf(modList); } @@ -330,5 +330,13 @@ public class ServerPing { this.id = Preconditions.checkNotNull(id, "id"); this.version = Preconditions.checkNotNull(version, "version"); } + + public String getId() { + return id; + } + + public String getVersion() { + return version; + } } }