Clarification du code de MinecraftVersion et TextProgressBar

This commit is contained in:
Marc Baloup 2016-06-17 17:19:10 +02:00
parent 7803262060
commit b3cfce8420
2 changed files with 9 additions and 26 deletions

View File

@ -1,22 +1,20 @@
package fr.pandacube.java.util; package fr.pandacube.java.util;
public enum MinecraftVersion { public enum MinecraftVersion {
v1_7_2_to_1_7_5(4, "1.7.2-1.7.5", false), 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", false), v1_7_6_to_1_7_10(5, "1.7.6-1.7.10"),
v1_8(47, "1.8.x", true), v1_8(47, "1.8.x"),
v1_9(107, "1.9", false), v1_9(107, "1.9"),
v1_9_1(108, "1.9.1", false), v1_9_1(108, "1.9.1"),
v1_9_2(109, "1.9.2", false), v1_9_2(109, "1.9.2"),
v1_9_3_to_1_9_4(110, "1.9.3-1.9.4", true); v1_9_3_to_1_9_4(110, "1.9.3-1.9.4");
public final int versionNumber; public final int versionNumber;
public final String versionDisplay; public final String versionDisplay;
public final boolean available;
private MinecraftVersion(int v, String d, boolean a) { private MinecraftVersion(int v, String d) {
versionNumber = v; versionNumber = v;
versionDisplay = d; versionDisplay = d;
available = a;
} }
@ -32,17 +30,4 @@ public enum MinecraftVersion {
return null; 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;
}
} }

View File

@ -63,9 +63,7 @@ public class TextProgressBar {
public static String progressBar(double value, ChatColor color, double max, int nbCar) public static String progressBar(double value, ChatColor color, double max, int nbCar)
{ {
double[] d = new double[1]; d[0] = value; return progressBar(new double[] {value}, new ChatColor[] {color}, max, nbCar);
ChatColor[] c = new ChatColor[1]; c[0] = color;
return progressBar(d, c, max, nbCar);
} }