mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Added version-based handling, bump version to 9.1.1
This commit is contained in:
1 parent
245465dc8c
commit
ddc9e68f8e
7 files changed
+60
-39
No files matched your search
@@ -160,28 +160,6 @@ public final class MekanismUtils
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the latest version using getHTML and returns it as a string.
|
||||
* @return latest version
|
||||
*/
|
||||
public static String getLatestVersion()
|
||||
{
|
||||
String[] text = merge(getHTML("https://dl.dropbox.com/u/90411166/Mod%20Versions/Mekanism.txt")).split(":");
|
||||
if(text.length > 1 && !text[0].contains("UTF-8") && !text[0].contains("HTML") && !text[0].contains("http")) return text[0];
|
||||
return "null";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the recent news using getHTML and returns it as a string.
|
||||
* @return recent news
|
||||
*/
|
||||
public static String getRecentNews()
|
||||
{
|
||||
String[] text = merge(getHTML("https://dl.dropbox.com/u/90411166/Mod%20Versions/Mekanism.txt")).split(":");
|
||||
if(text.length > 1 && !text[1].contains("UTF-8") && !text[1].contains("HTML") && !text[1].contains("http")) return text[1];
|
||||
return "null";
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the donator list by retrieving the most recent information from a foreign document.
|
||||
*/
|
||||
@@ -202,17 +180,14 @@ public final class MekanismUtils
|
||||
*/
|
||||
public static List<String> getHTML(String urlToRead)
|
||||
{
|
||||
URL url;
|
||||
HttpURLConnection conn;
|
||||
BufferedReader rd;
|
||||
String line;
|
||||
List<String> result = new ArrayList<String>();
|
||||
|
||||
try {
|
||||
url = new URL(urlToRead);
|
||||
conn = (HttpURLConnection)url.openConnection();
|
||||
URL url = new URL(urlToRead);
|
||||
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
|
||||
conn.setRequestMethod("GET");
|
||||
rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||
|
||||
while((line = rd.readLine()) != null)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user