3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 00:00:28 +01:00

Don't use GSON >.>

Dieser Commit ist enthalten in:
Myles 2016-03-06 11:03:41 +00:00
Ursprung 2a247595c8
Commit 840c90f871

Datei anzeigen

@ -1,12 +1,13 @@
package us.myles.ViaVersion.update; package us.myles.ViaVersion.update;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import us.myles.ViaVersion.api.ViaVersion; import us.myles.ViaVersion.api.ViaVersion;
import java.io.BufferedReader; import java.io.BufferedReader;
@ -106,9 +107,15 @@ public class UpdateUtil {
content = content + input; content = content + input;
} }
br.close(); br.close();
JsonParser parser = new JsonParser(); JSONParser parser = new JSONParser();
JsonObject statistics = (JsonObject) parser.parse(content); JSONObject statistics;
return statistics.get("version").getAsString(); try {
statistics = (JSONObject) parser.parse(content);
} catch (ParseException e) {
e.printStackTrace();
return null;
}
return (String) statistics.get("version");
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
return null; return null;
} catch (IOException e) { } catch (IOException e) {