Add MinecraftVersion#toStringAnd() and #toStringOr()

This commit is contained in:
Marc Baloup 2021-02-11 18:33:13 +01:00
parent 861a41f6e0
commit 574ef6e4d0
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893

View File

@ -141,9 +141,17 @@ public enum MinecraftVersion {
@Override
public String toString() {
return toStringAnd();
}
public String toStringAnd() {
return StringUtil.joinGrammatically(", ", " et ", versionDisplay);
}
public String toStringOr() {
return StringUtil.joinGrammatically(", ", " ou ", versionDisplay);
}
public static MinecraftVersion getVersion(int v) {
for (MinecraftVersion mcV : values())
if (mcV.id == v) return mcV;