From 574ef6e4d062d61be18f45ba1057a06c54f03565 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Thu, 11 Feb 2021 18:33:13 +0100 Subject: [PATCH] Add MinecraftVersion#toStringAnd() and #toStringOr() --- src/main/java/fr/pandacube/util/MinecraftVersion.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/fr/pandacube/util/MinecraftVersion.java b/src/main/java/fr/pandacube/util/MinecraftVersion.java index 050351e..20f203c 100644 --- a/src/main/java/fr/pandacube/util/MinecraftVersion.java +++ b/src/main/java/fr/pandacube/util/MinecraftVersion.java @@ -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;