diff --git a/api/src/main/java/com/velocitypowered/api/proxy/server/ServerInfo.java b/api/src/main/java/com/velocitypowered/api/proxy/server/ServerInfo.java index e1317f9e8..83e5e33e1 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/server/ServerInfo.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/server/ServerInfo.java @@ -9,7 +9,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; * ServerInfo represents a server that a player can connect to. This object is immutable and safe * for concurrent access. */ -public final class ServerInfo { +public final class ServerInfo implements Comparable { private final String name; private final InetSocketAddress address; @@ -58,4 +58,9 @@ public final class ServerInfo { public final int hashCode() { return Objects.hash(name, address); } + + @Override + public int compareTo(ServerInfo o) { + return this.name.compareTo(o.getName()); + } }