1.6.0 (test26)
This commit is contained in:
parent
ed1e4b0483
commit
a2a3e75745
10
README
10
README
@ -1,4 +1,4 @@
|
|||||||
Minecraft Land Generator version 1.6.0 Testing 22
|
Minecraft Land Generator version 1.6.0 Testing 26
|
||||||
|
|
||||||
Updated November 4, 2011
|
Updated November 4, 2011
|
||||||
|
|
||||||
@ -24,9 +24,10 @@ Version History:
|
|||||||
Morlok8k:
|
Morlok8k:
|
||||||
|
|
||||||
1.6.0
|
1.6.0
|
||||||
- Added the ability to download files from the internet (specifically for the BuildID file, and conf file)
|
- Added the ability to download files from the internet
|
||||||
- Added the ability to check what version the .jar is. (Using MD5 hashes, timestamps, and the BuildID file)
|
- Added the ability to check what version the .jar is. (Using MD5 hashes, timestamps, and the BuildID file)
|
||||||
- COde Refactoring
|
- Added "-update" to download new versions of MLG directly from github.
|
||||||
|
- Code Refactoring
|
||||||
- Code Formatting
|
- Code Formatting
|
||||||
- Code Optimization
|
- Code Optimization
|
||||||
|
|
||||||
@ -125,6 +126,9 @@ Switches:
|
|||||||
-y# : set the X offset to generate land around (example: -y0)
|
-y# : set the X offset to generate land around (example: -y0)
|
||||||
|
|
||||||
Other options:
|
Other options:
|
||||||
|
java -jar MinecraftLandGenerator.jar -update
|
||||||
|
Checks for and downloads new versions of MLG online.
|
||||||
|
|
||||||
java -jar MinecraftLandGenerator.jar -printspawn
|
java -jar MinecraftLandGenerator.jar -printspawn
|
||||||
java -jar MinecraftLandGenerator.jar -ps
|
java -jar MinecraftLandGenerator.jar -ps
|
||||||
Outputs the current world's spawn point coordinates.
|
Outputs the current world's spawn point coordinates.
|
||||||
|
@ -4,3 +4,4 @@
|
|||||||
E77F9F6977FA5BE75D81CA8E3584DCF8=1320404362000#MLG v1.6.0 Testing 16
|
E77F9F6977FA5BE75D81CA8E3584DCF8=1320404362000#MLG v1.6.0 Testing 16
|
||||||
867265064E26F0F83EAC586C80ED5604=1320416550000# MLG v1.6.0 Testing 21
|
867265064E26F0F83EAC586C80ED5604=1320416550000# MLG v1.6.0 Testing 21
|
||||||
A176A5BC42F9BBDDE2F9D38D0B761DE0=1320416854000# MLG v1.6.0 Testing 22
|
A176A5BC42F9BBDDE2F9D38D0B761DE0=1320416854000# MLG v1.6.0 Testing 22
|
||||||
|
B34874112FC61567034E9988C8D576D1=1320421331000# MLG v1.6.0 Testing 26
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#Minecraft Land Generator Configuration File: Version: 1.6.0 Testing 22
|
#Minecraft Land Generator Configuration File: Version: 1.6.0 Testing 26
|
||||||
#Authors: Corrodias, Morlok8k, pr0f1x
|
#Authors: Corrodias, Morlok8k, pr0f1x
|
||||||
#Auto-Generated: Friday, November 4, 2011 at 7:28 AM Pacific Daylight Time
|
#Auto-Generated: Friday, November 4, 2011 at 8:42 AM Pacific Daylight Time
|
||||||
|
|
||||||
#Line to run server:
|
#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
|
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.
@ -45,10 +45,14 @@ import org.jnbt.Tag;
|
|||||||
* @author Corrodias, Morlok8k, pr0f1x
|
* @author Corrodias, Morlok8k, pr0f1x
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* @author morlok8k
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
// Version Number!
|
// Version Number!
|
||||||
private static final String VERSION = "1.6.0 Testing 22";
|
private static final String VERSION = "1.6.0 Testing 26";
|
||||||
private static final String AUTHORS = "Corrodias, Morlok8k, pr0f1x";
|
private static final String AUTHORS = "Corrodias, Morlok8k, pr0f1x";
|
||||||
|
|
||||||
private static final String fileSeparator = System.getProperty("file.separator");
|
private static final String fileSeparator = System.getProperty("file.separator");
|
||||||
@ -101,6 +105,7 @@ public class Main {
|
|||||||
private static boolean isCompiledAsJar = false;
|
private static boolean isCompiledAsJar = false;
|
||||||
private static String MLG_Current_Hash = null;
|
private static String MLG_Current_Hash = null;
|
||||||
private static int inf_loop_protect_BuildID = 0;
|
private static int inf_loop_protect_BuildID = 0;
|
||||||
|
private static ArrayList<String> timeStamps = new ArrayList<String>();
|
||||||
|
|
||||||
private static final String github_MLG_Conf_URL =
|
private static final String github_MLG_Conf_URL =
|
||||||
"https://raw.github.com/Morlok8k/MinecraftLandGenerator/master/bin/MinecraftLandGenerator.conf";
|
"https://raw.github.com/Morlok8k/MinecraftLandGenerator/master/bin/MinecraftLandGenerator.conf";
|
||||||
@ -113,7 +118,7 @@ public class Main {
|
|||||||
|
|
||||||
//////
|
//////
|
||||||
|
|
||||||
private static final boolean testing = false; // a constant to display more output when debugging
|
private static final boolean testing = false; // display more output when debugging
|
||||||
|
|
||||||
//////
|
//////
|
||||||
|
|
||||||
@ -180,7 +185,7 @@ public class Main {
|
|||||||
if (args[0].equalsIgnoreCase("-conf")) {
|
if (args[0].equalsIgnoreCase("-conf")) {
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("download")) {
|
if (args[0].equalsIgnoreCase("download")) {
|
||||||
boolean fileSuccess = downloadFile(github_MLG_Conf_URL);
|
boolean fileSuccess = downloadFile(github_MLG_Conf_URL, testing);
|
||||||
if (fileSuccess) {
|
if (fileSuccess) {
|
||||||
System.out.println(MLG + MinecraftLandGeneratorConf + " file downloaded.");
|
System.out.println(MLG + MinecraftLandGeneratorConf + " file downloaded.");
|
||||||
return;
|
return;
|
||||||
@ -254,6 +259,9 @@ public class Main {
|
|||||||
} else if (args[0].equalsIgnoreCase("-build")) {
|
} else if (args[0].equalsIgnoreCase("-build")) {
|
||||||
buildID();
|
buildID();
|
||||||
return;
|
return;
|
||||||
|
} else if (args[0].equalsIgnoreCase("-update")) {
|
||||||
|
updateMLG();
|
||||||
|
return;
|
||||||
} else if (args[0].equalsIgnoreCase("-readme")) {
|
} else if (args[0].equalsIgnoreCase("-readme")) {
|
||||||
readMe(args[1]);
|
readMe(args[1]);
|
||||||
return;
|
return;
|
||||||
@ -357,7 +365,7 @@ public class Main {
|
|||||||
|
|
||||||
if (doneText == null) { // MLG 1.4.0
|
if (doneText == null) { // MLG 1.4.0
|
||||||
oldConf = true;
|
oldConf = true;
|
||||||
} else if (preparingText == null) { // MLG 1.4.0
|
} else if (preparingText == null) { // MLG 1.4.0O
|
||||||
oldConf = true;
|
oldConf = true;
|
||||||
} else if (preparingLevel == null) { // MLG 1.4.5 / 1.5.0
|
} else if (preparingLevel == null) { // MLG 1.4.5 / 1.5.0
|
||||||
oldConf = true;
|
oldConf = true;
|
||||||
@ -692,13 +700,7 @@ public class Main {
|
|||||||
IntTag spawnZ = (IntTag) newData.get("SpawnZ");
|
IntTag spawnZ = (IntTag) newData.get("SpawnZ");
|
||||||
|
|
||||||
randomSeed = (LongTag) newData.get("RandomSeed");
|
randomSeed = (LongTag) newData.get("RandomSeed");
|
||||||
System.out.println(MLG + "Seed: " + randomSeed.getValue()); // lets
|
System.out.println(MLG + "Seed: " + randomSeed.getValue()); // lets output the seed, cause why not?
|
||||||
// output
|
|
||||||
// the
|
|
||||||
// seed,
|
|
||||||
// cause
|
|
||||||
// why
|
|
||||||
// not?
|
|
||||||
|
|
||||||
Integer[] ret =
|
Integer[] ret =
|
||||||
new Integer[] { spawnX.getValue(), spawnY.getValue(), spawnZ.getValue() };
|
new Integer[] { spawnX.getValue(), spawnY.getValue(), spawnZ.getValue() };
|
||||||
@ -1208,9 +1210,10 @@ public class Main {
|
|||||||
+ "Morlok8k:" + newLine
|
+ "Morlok8k:" + newLine
|
||||||
+ newLine
|
+ newLine
|
||||||
+ "1.6.0" + newLine
|
+ "1.6.0" + newLine
|
||||||
+ "- Added the ability to download files from the internet (specifically for the BuildID file, and conf file)" + newLine
|
+ "- Added the ability to download files from the internet" + newLine
|
||||||
+ "- Added the ability to check what version the .jar is. (Using MD5 hashes, timestamps, and the BuildID file)" + newLine
|
+ "- Added the ability to check what version the .jar is. (Using MD5 hashes, timestamps, and the BuildID file)" + newLine
|
||||||
+ "- COde Refactoring" + newLine
|
+ "- Added \"-update\" to download new versions of MLG directly from github." + newLine
|
||||||
|
+ "- Code Refactoring" + newLine
|
||||||
+ "- Code Formatting" + newLine
|
+ "- Code Formatting" + newLine
|
||||||
+ "- Code Optimization" + newLine
|
+ "- Code Optimization" + newLine
|
||||||
+ newLine
|
+ newLine
|
||||||
@ -1322,9 +1325,11 @@ public class Main {
|
|||||||
*
|
*
|
||||||
* @author Morlok8k
|
* @author Morlok8k
|
||||||
* @param URL
|
* @param URL
|
||||||
*
|
* URL in a String
|
||||||
|
* @param Output
|
||||||
|
* Displays output if true
|
||||||
*/
|
*/
|
||||||
public static boolean downloadFile(String URL) {
|
public static boolean downloadFile(String URL, boolean Output) {
|
||||||
|
|
||||||
boolean success = true;
|
boolean success = true;
|
||||||
|
|
||||||
@ -1335,7 +1340,7 @@ public class Main {
|
|||||||
fileName = String.valueOf(System.currentTimeMillis());
|
fileName = String.valueOf(System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (testing) {
|
if (Output) {
|
||||||
System.out.println(MLG + "Downloading: " + URL);
|
System.out.println(MLG + "Downloading: " + URL);
|
||||||
System.out.println(MLG + "Saving as: " + fileName);
|
System.out.println(MLG + "Saving as: " + fileName);
|
||||||
}
|
}
|
||||||
@ -1359,12 +1364,12 @@ public class Main {
|
|||||||
}
|
}
|
||||||
bout.close();
|
bout.close();
|
||||||
in.close();
|
in.close();
|
||||||
if (testing) {
|
if (Output) {
|
||||||
System.out.println(count + " byte(s) copied");
|
System.out.println(count + " byte(s) copied");
|
||||||
}
|
}
|
||||||
timeTracking[1] = System.currentTimeMillis();
|
timeTracking[1] = System.currentTimeMillis();
|
||||||
differenceTime = (timeTracking[1] - timeTracking[0]) / 2;
|
differenceTime = (timeTracking[1] - timeTracking[0]) / 2;
|
||||||
if (testing) {
|
if (Output) {
|
||||||
System.out.println(String.format(MLG + "Elapsed Time: %dm%ds",
|
System.out.println(String.format(MLG + "Elapsed Time: %dm%ds",
|
||||||
(differenceTime % (1000 * 60 * 60)) / (1000 * 60),
|
(differenceTime % (1000 * 60 * 60)) / (1000 * 60),
|
||||||
((differenceTime % (1000 * 60 * 60)) % (1000 * 60)) / 1000));
|
((differenceTime % (1000 * 60 * 60)) % (1000 * 60)) / 1000));
|
||||||
@ -1379,7 +1384,7 @@ public class Main {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
if (testing) {
|
if (Output) {
|
||||||
System.out.println(MLG + "Done");
|
System.out.println(MLG + "Done");
|
||||||
}
|
}
|
||||||
return success;
|
return success;
|
||||||
@ -1396,7 +1401,7 @@ public class Main {
|
|||||||
public static void buildID() {
|
public static void buildID() {
|
||||||
|
|
||||||
// download BuildID from Github.
|
// download BuildID from Github.
|
||||||
boolean fileSuccess = downloadFile(github_MLG_BuildID_URL);
|
boolean fileSuccess = downloadFile(github_MLG_BuildID_URL, testing);
|
||||||
if (fileSuccess) {
|
if (fileSuccess) {
|
||||||
System.out.println(MLG + buildIDFile + " file downloaded.");
|
System.out.println(MLG + buildIDFile + " file downloaded.");
|
||||||
|
|
||||||
@ -1528,7 +1533,8 @@ public class Main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int tsCount = 0;
|
int tsCount = 0;
|
||||||
ArrayList<String> timeStamps = new ArrayList<String>();
|
|
||||||
|
timeStamps.clear();
|
||||||
|
|
||||||
if (MLG_Last_Modified_Date == null) {
|
if (MLG_Last_Modified_Date == null) {
|
||||||
boolean foundLine = false;
|
boolean foundLine = false;
|
||||||
@ -1573,9 +1579,38 @@ public class Main {
|
|||||||
}
|
}
|
||||||
in.close();
|
in.close();
|
||||||
|
|
||||||
|
if (foundLine == false) {
|
||||||
|
// System.out.println("[DEBUG] FoundLine False");
|
||||||
|
buildID();
|
||||||
|
readBuildID(); // yes I'm calling the function from itself. potential infinite loop? possibly. I haven't encountered it yet!
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.err.println(MLG + "Cant Read " + buildIDFile + "!");
|
||||||
|
// e.printStackTrace();
|
||||||
|
buildID();
|
||||||
|
readBuildID();
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates MLG to the Latest Version
|
||||||
|
*
|
||||||
|
* @author Morlok8k
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public static void updateMLG() {
|
||||||
|
|
||||||
|
buildID();
|
||||||
|
|
||||||
Iterator<String> e = timeStamps.iterator();
|
Iterator<String> e = timeStamps.iterator();
|
||||||
String s;
|
String s;
|
||||||
int diff;
|
int diff;
|
||||||
|
|
||||||
//boolean renameFailed = false;
|
//boolean renameFailed = false;
|
||||||
|
|
||||||
while (e.hasNext()) {
|
while (e.hasNext()) {
|
||||||
@ -1608,7 +1643,7 @@ public class Main {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean fileSuccess = downloadFile(github_MLG_jar_URL);
|
boolean fileSuccess = downloadFile(github_MLG_jar_URL, true);
|
||||||
if (fileSuccess) {
|
if (fileSuccess) {
|
||||||
System.out.println(MLG + "MinecraftLandGenerator.jar" + " downloaded.");
|
System.out.println(MLG + "MinecraftLandGenerator.jar" + " downloaded.");
|
||||||
return;
|
return;
|
||||||
@ -1616,23 +1651,6 @@ public class Main {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (foundLine == false) {
|
|
||||||
// System.out.println("[DEBUG] FoundLine False");
|
|
||||||
buildID();
|
|
||||||
readBuildID(); // yes I'm calling the function from itself. potential infinite loop? possibly. I haven't encountered it yet!
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
System.err.println(MLG + "Cant Read " + buildIDFile + "!");
|
|
||||||
// e.printStackTrace();
|
|
||||||
buildID();
|
|
||||||
readBuildID();
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1766,6 +1784,9 @@ public class Main {
|
|||||||
+ " -y# : set the X offset to generate land around (example: -y0)" + newLine
|
+ " -y# : set the X offset to generate land around (example: -y0)" + newLine
|
||||||
+ newLine
|
+ newLine
|
||||||
+ "Other options:" + newLine
|
+ "Other options:" + newLine
|
||||||
|
+ " java -jar MinecraftLandGenerator.jar -update" + newLine
|
||||||
|
+ " Checks for and downloads new versions of MLG online." + newLine
|
||||||
|
+ newLine
|
||||||
+ " java -jar MinecraftLandGenerator.jar -printspawn" + newLine
|
+ " java -jar MinecraftLandGenerator.jar -printspawn" + newLine
|
||||||
+ " java -jar MinecraftLandGenerator.jar -ps" + newLine
|
+ " java -jar MinecraftLandGenerator.jar -ps" + newLine
|
||||||
+ " Outputs the current world's spawn point coordinates." + newLine
|
+ " Outputs the current world's spawn point coordinates." + newLine
|
||||||
|
Reference in New Issue
Block a user