[Bugfix] Fix ServerDescription to use proper compare() to prevent conflict with matching names, authors and versions

This commit is contained in:
Shadowrs
2018-09-14 13:16:30 +01:00
parent 788fe3e6c8
commit 8a2255ac90
@@ -39,7 +39,10 @@ public class ServerDescription implements Comparable<ServerDescription> {
@Override @Override
public int compareTo(ServerDescription o) { public int compareTo(ServerDescription o) {
if (this.getServerName().equalsIgnoreCase(o.getServerName())) { if (this.getServerName().equalsIgnoreCase(o.getServerName())) {
return 1; if (getAuthor().equals(o.getAuthor())) {
return Double.compare(o.getRevision(), getRevision());
}
return getAuthor().compareTo(o.getAuthor());
} }
return this.getServerName().compareTo(o.getServerName()); return this.getServerName().compareTo(o.getServerName());
} }