From b3cfce84204a894364bf77bc1ff71cba1c887a91 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Fri, 17 Jun 2016 17:19:10 +0200 Subject: [PATCH] Clarification du code de MinecraftVersion et TextProgressBar --- .../pandacube/java/util/MinecraftVersion.java | 31 +++++-------------- .../util/chat_display/TextProgressBar.java | 4 +-- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/src/fr/pandacube/java/util/MinecraftVersion.java b/src/fr/pandacube/java/util/MinecraftVersion.java index 8f8b8a9..1d2587b 100644 --- a/src/fr/pandacube/java/util/MinecraftVersion.java +++ b/src/fr/pandacube/java/util/MinecraftVersion.java @@ -1,22 +1,20 @@ package fr.pandacube.java.util; public enum MinecraftVersion { - v1_7_2_to_1_7_5(4, "1.7.2-1.7.5", false), - v1_7_6_to_1_7_10(5, "1.7.6-1.7.10", false), - v1_8(47, "1.8.x", true), - v1_9(107, "1.9", false), - v1_9_1(108, "1.9.1", false), - v1_9_2(109, "1.9.2", false), - v1_9_3_to_1_9_4(110, "1.9.3-1.9.4", true); + v1_7_2_to_1_7_5(4, "1.7.2-1.7.5"), + v1_7_6_to_1_7_10(5, "1.7.6-1.7.10"), + v1_8(47, "1.8.x"), + v1_9(107, "1.9"), + v1_9_1(108, "1.9.1"), + v1_9_2(109, "1.9.2"), + v1_9_3_to_1_9_4(110, "1.9.3-1.9.4"); public final int versionNumber; public final String versionDisplay; - public final boolean available; - private MinecraftVersion(int v, String d, boolean a) { + private MinecraftVersion(int v, String d) { versionNumber = v; versionDisplay = d; - available = a; } @@ -32,17 +30,4 @@ public enum MinecraftVersion { return null; } - - public static String displayAvailableVersions() { - boolean first = true; - String concat = ""; - for (MinecraftVersion v : values()) { - if (!v.available) continue; - if (!first) concat += ", "; - first = false; - concat += v.versionDisplay; - } - - return concat; - } } diff --git a/src/fr/pandacube/java/util/chat_display/TextProgressBar.java b/src/fr/pandacube/java/util/chat_display/TextProgressBar.java index a2e9536..2344d32 100644 --- a/src/fr/pandacube/java/util/chat_display/TextProgressBar.java +++ b/src/fr/pandacube/java/util/chat_display/TextProgressBar.java @@ -63,9 +63,7 @@ public class TextProgressBar { public static String progressBar(double value, ChatColor color, double max, int nbCar) { - double[] d = new double[1]; d[0] = value; - ChatColor[] c = new ChatColor[1]; c[0] = color; - return progressBar(d, c, max, nbCar); + return progressBar(new double[] {value}, new ChatColor[] {color}, max, nbCar); }