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
1 changed files with 8 additions and 0 deletions

View File

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