1.6.0 (test21)
This commit is contained in:
parent
1c49b7ead2
commit
9946e44973
2
README
2
README
@ -1,4 +1,4 @@
|
||||
Minecraft Land Generator version 1.6.0 Testing 16
|
||||
Minecraft Land Generator version 1.6.0 Testing 21
|
||||
|
||||
Updated November 4, 2011
|
||||
|
||||
|
@ -2,3 +2,4 @@
|
||||
293A184EB26A62AE6D64CEB01BAD9537=1320399076000#MLG v1.6.0 Testing 11
|
||||
4F00853101546B5C030F5D89036EC574=1320402115000#MLG v1.6.0 Testing 12
|
||||
E77F9F6977FA5BE75D81CA8E3584DCF8=1320404362000#MLG v1.6.0 Testing 16
|
||||
867265064E26F0F83EAC586C80ED5604=1320416550000# MLG v1.6.0 Testing 21
|
||||
|
@ -1,6 +1,6 @@
|
||||
#Minecraft Land Generator Configuration File: Version: 1.6.0 Testing 16
|
||||
#Minecraft Land Generator Configuration File: Version: 1.6.0 Testing 21
|
||||
#Authors: Corrodias, Morlok8k, pr0f1x
|
||||
#Auto-Generated: Friday, November 4, 2011 at 3:59 AM Pacific Daylight Time
|
||||
#Auto-Generated: Friday, November 4, 2011 at 7:22 AM Pacific Daylight Time
|
||||
|
||||
#Line to run server:
|
||||
Java=java -Djava.awt.headless=true -Djline.terminal=jline.UnsupportedTerminal -Duser.language=en -Xms1024m -Xmx1024m -Xincgc -jar minecraft_server.jar nogui
|
||||
|
Binary file not shown.
@ -23,8 +23,10 @@ import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
@ -41,11 +43,12 @@ import org.jnbt.Tag;
|
||||
/**
|
||||
*
|
||||
* @author Corrodias, Morlok8k, pr0f1x
|
||||
*
|
||||
*/
|
||||
public class Main {
|
||||
|
||||
// Version Number!
|
||||
private static final String VERSION = "1.6.0 Testing 16";
|
||||
private static final String VERSION = "1.6.0 Testing 21";
|
||||
private static final String AUTHORS = "Corrodias, Morlok8k, pr0f1x";
|
||||
|
||||
private static final String fileSeparator = System.getProperty("file.separator");
|
||||
@ -103,6 +106,9 @@ public class Main {
|
||||
"https://raw.github.com/Morlok8k/MinecraftLandGenerator/master/bin/MinecraftLandGenerator.conf";
|
||||
private static final String github_MLG_BuildID_URL =
|
||||
"https://raw.github.com/Morlok8k/MinecraftLandGenerator/master/bin/MLG-BuildID";
|
||||
private static final String github_MLG_jar_URL =
|
||||
"https://raw.github.com/Morlok8k/MinecraftLandGenerator/master/bin/MinecraftLandGenerator.jar";
|
||||
|
||||
private static final String MinecraftLandGeneratorConf = "MinecraftLandGenerator.conf";
|
||||
|
||||
//////
|
||||
@ -1435,14 +1441,18 @@ public class Main {
|
||||
}
|
||||
|
||||
try {
|
||||
String line;
|
||||
|
||||
BufferedReader in = new BufferedReader(new FileReader(buildIDFile));
|
||||
BufferedWriter out = new BufferedWriter(new FileWriter(buildIDFile + ".temp"));
|
||||
String line;
|
||||
|
||||
while ((line = in.readLine()) != null) {
|
||||
|
||||
if (line.contains(MLG_Current_Hash)) {
|
||||
notNew = true;
|
||||
// System.out.println("[DEBUG] NotNew");
|
||||
if (testing) {
|
||||
System.out.println("[DEBUG] NotNew");
|
||||
}
|
||||
}
|
||||
|
||||
out.write(line);
|
||||
@ -1517,6 +1527,9 @@ public class Main {
|
||||
}
|
||||
}
|
||||
|
||||
int tsCount = 0;
|
||||
ArrayList<String> timeStamps = new ArrayList<String>();
|
||||
|
||||
if (MLG_Last_Modified_Date == null) {
|
||||
boolean foundLine = false;
|
||||
try {
|
||||
@ -1525,10 +1538,6 @@ public class Main {
|
||||
|
||||
while ((line = in.readLine()) != null) {
|
||||
|
||||
if (line.contains(MLG_Current_Hash)) {
|
||||
// System.out.println("[DEBUG] Found!");
|
||||
foundLine = true;
|
||||
|
||||
int pos = line.indexOf('=');
|
||||
int end = line.lastIndexOf('#'); // comments, ignored lines
|
||||
|
||||
@ -1539,11 +1548,23 @@ public class Main {
|
||||
end = line.length();
|
||||
}
|
||||
|
||||
timeStamps.add(line.substring(pos + 1, end));
|
||||
|
||||
if (testing) {
|
||||
System.out.println(timeStamps.get(tsCount));
|
||||
}
|
||||
|
||||
tsCount++;
|
||||
|
||||
if (line.contains(MLG_Current_Hash)) {
|
||||
// System.out.println("[DEBUG] Found!");
|
||||
foundLine = true;
|
||||
|
||||
if (pos != -1) {
|
||||
if (line.substring(0, pos).equals(MLG_Current_Hash)) {
|
||||
MLG_Last_Modified_Date =
|
||||
new Date(new Long(line.substring(pos + 1, end)));
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1552,6 +1573,50 @@ public class Main {
|
||||
}
|
||||
in.close();
|
||||
|
||||
Iterator<String> e = timeStamps.iterator();
|
||||
String s;
|
||||
int diff;
|
||||
//boolean renameFailed = false;
|
||||
|
||||
while (e.hasNext()) {
|
||||
s = e.next();
|
||||
diff = MLG_Last_Modified_Date.compareTo(new Date(new Long(s)));
|
||||
//System.out.println(diff);
|
||||
|
||||
if (diff < 0) { // if this is less than 0, there is a new version of MLG on the Internet!
|
||||
System.out
|
||||
.println("There is a NEW VERSION Of Minecraft Land Generator available online!");
|
||||
|
||||
try {
|
||||
File fileRename = new File("MinecraftLandGenerator.jar");
|
||||
fileRename.renameTo(new File("MinecraftLandGenerator.jar" + ".old"));
|
||||
} catch (Exception e1) {
|
||||
System.out.println("Rename failed");
|
||||
e1.printStackTrace();
|
||||
|
||||
try {
|
||||
copyFile(new File("MinecraftLandGenerator.jar"), new File(
|
||||
"MinecraftLandGenerator.jar" + ".old"));
|
||||
File fileDelete = new File("MinecraftLandGenerator.jar");
|
||||
fileDelete.delete();
|
||||
} catch (Exception e2) {
|
||||
System.out.println("Rename 2 failed");
|
||||
e2.printStackTrace();
|
||||
//renameFailed = true;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
boolean fileSuccess = downloadFile(github_MLG_jar_URL);
|
||||
if (fileSuccess) {
|
||||
System.out.println(MLG + "MinecraftLandGenerator.jar" + " downloaded.");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (foundLine == false) {
|
||||
// System.out.println("[DEBUG] FoundLine False");
|
||||
buildID();
|
||||
|
Reference in New Issue
Block a user