From 7803262060c81cedac04526669a47e61a45bdc8b Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Thu, 2 Jun 2016 18:10:47 +0200 Subject: [PATCH] =?UTF-8?q?Support=20MC=201.9=20+=20passage=20=C3=A0=20la?= =?UTF-8?q?=20version=201.0-beta3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .classpath | 4 +-- make_jar.jardesc | 2 +- resources/bungee.yml | 2 +- resources/plugin.yml | 2 +- .../pandacube/java/util/MinecraftVersion.java | 35 ++++++++++++++++--- 5 files changed, 36 insertions(+), 9 deletions(-) diff --git a/.classpath b/.classpath index 972e07b..a2d0a31 100644 --- a/.classpath +++ b/.classpath @@ -3,8 +3,8 @@ - - + + diff --git a/make_jar.jardesc b/make_jar.jardesc index b5f93b3..4443647 100644 --- a/make_jar.jardesc +++ b/make_jar.jardesc @@ -1,6 +1,6 @@ - + diff --git a/resources/bungee.yml b/resources/bungee.yml index e1c0854..e668fef 100644 --- a/resources/bungee.yml +++ b/resources/bungee.yml @@ -1,4 +1,4 @@ name: PandacubeUtil main: fr.pandacube.java.BungeeMain -version: 1.0-beta2 +version: 1.0-beta3 author: Marc Baloup (marcbal) \ No newline at end of file diff --git a/resources/plugin.yml b/resources/plugin.yml index 76b2a79..6069cbb 100644 --- a/resources/plugin.yml +++ b/resources/plugin.yml @@ -1,4 +1,4 @@ name: PandacubeUtil main: fr.pandacube.java.SpigotMain -version: 1.0-beta2 +version: 1.0-beta3 author: Marc Baloup (marcbal) \ No newline at end of file diff --git a/src/fr/pandacube/java/util/MinecraftVersion.java b/src/fr/pandacube/java/util/MinecraftVersion.java index dc675c1..8f8b8a9 100644 --- a/src/fr/pandacube/java/util/MinecraftVersion.java +++ b/src/fr/pandacube/java/util/MinecraftVersion.java @@ -1,14 +1,27 @@ package fr.pandacube.java.util; public enum MinecraftVersion { - v1_7_2_to_1_7_5(4), - v1_7_6_to_1_7_10(5), - v1_8(47); + 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); public final int versionNumber; + public final String versionDisplay; + public final boolean available; - private MinecraftVersion(int v) { + private MinecraftVersion(int v, String d, boolean a) { versionNumber = v; + versionDisplay = d; + available = a; + } + + + public String toString() { + return versionDisplay; } public static MinecraftVersion getVersion(int v) { @@ -18,4 +31,18 @@ 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; + } }