1.4.3
This commit is contained in:
parent
821e3909e5
commit
476b59b89d
8
README
8
README
@ -1,6 +1,6 @@
|
|||||||
Minecraft Land Generator version 1.4.2
|
Minecraft Land Generator version 1.4.3
|
||||||
|
|
||||||
Updated May 12, 2011
|
Updated May 14, 2011
|
||||||
|
|
||||||
Original Code by Corrodias November 2010
|
Original Code by Corrodias November 2010
|
||||||
Enhanced Code by Morlok8k Feb. 2011 to Now (or at least to the date listed above!)
|
Enhanced Code by Morlok8k Feb. 2011 to Now (or at least to the date listed above!)
|
||||||
@ -24,6 +24,10 @@ The JNLP library is included (inside the .jar) as jnbt-1.1.jar. It is not public
|
|||||||
|
|
||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
Version History:
|
Version History:
|
||||||
|
Morlok8k:
|
||||||
|
|
||||||
|
1.4.3
|
||||||
|
- Fixed "-ps","-printspawn" as I had forgot I had broken it in 1.4.0 - due to config file change.
|
||||||
|
|
||||||
1.4.2
|
1.4.2
|
||||||
- No New Features
|
- No New Features
|
||||||
|
Binary file not shown.
@ -42,7 +42,7 @@ import org.jnbt.Tag;
|
|||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
//Version Number!
|
//Version Number!
|
||||||
private static final String VERSION = "1.4.2";
|
private static final String VERSION = "1.4.3";
|
||||||
|
|
||||||
private static final String separator = System.getProperty("file.separator");
|
private static final String separator = System.getProperty("file.separator");
|
||||||
//private static final String classpath = System.getProperty("java.class.path");
|
//private static final String classpath = System.getProperty("java.class.path");
|
||||||
@ -513,6 +513,9 @@ public class Main {
|
|||||||
*/
|
*/
|
||||||
protected static void runMinecraft(ProcessBuilder minecraft, boolean verbose, boolean alternate, String javaLine) throws IOException {
|
protected static void runMinecraft(ProcessBuilder minecraft, boolean verbose, boolean alternate, String javaLine) throws IOException {
|
||||||
System.out.println("Starting server.");
|
System.out.println("Starting server.");
|
||||||
|
|
||||||
|
boolean warning = false;
|
||||||
|
|
||||||
// monitor output and print to console where required.
|
// monitor output and print to console where required.
|
||||||
// STOP the server when it's done.
|
// STOP the server when it's done.
|
||||||
|
|
||||||
@ -595,6 +598,16 @@ public class Main {
|
|||||||
outputStream.flush();
|
outputStream.flush();
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
}
|
}
|
||||||
|
if (line.contains("[WARNING]")) { //If we have a severe error, stop...
|
||||||
|
System.out.println("");
|
||||||
|
System.out.println("Warning found: Stopping Minecraft Land Generator");
|
||||||
|
System.out.println("");
|
||||||
|
OutputStream outputStream = process.getOutputStream();
|
||||||
|
outputStream.write(stop); //if the warning was a fail to bind to port, we may need to write stop twice! (but since we write stop every time we see a warning, we should be fine.)
|
||||||
|
outputStream.flush();
|
||||||
|
outputStream.close();
|
||||||
|
warning = true;
|
||||||
|
}
|
||||||
if (line.contains("[SEVERE]")) { //If we have a severe error, stop...
|
if (line.contains("[SEVERE]")) { //If we have a severe error, stop...
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
System.out.println("Severe error found: Stopping server.");
|
System.out.println("Severe error found: Stopping server.");
|
||||||
@ -606,6 +619,11 @@ public class Main {
|
|||||||
//Quit!
|
//Quit!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (warning == true){
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -643,26 +661,27 @@ public class Main {
|
|||||||
BufferedReader in = new BufferedReader(new FileReader(config));
|
BufferedReader in = new BufferedReader(new FileReader(config));
|
||||||
String line;
|
String line;
|
||||||
while ((line = in.readLine()) != null) {
|
while ((line = in.readLine()) != null) {
|
||||||
int ignoreLine = line.indexOf('#');
|
|
||||||
if (ignoreLine == -1){
|
|
||||||
ignoreLine = 1;
|
|
||||||
} else if (ignoreLine == 0){
|
|
||||||
ignoreLine = 1;
|
|
||||||
} else if (ignoreLine == 1){
|
|
||||||
ignoreLine = 1;
|
|
||||||
} else {
|
|
||||||
ignoreLine = line.length();
|
|
||||||
}
|
|
||||||
if (ignoreLine != 1){
|
|
||||||
ignoreLine = line.length();
|
|
||||||
}
|
|
||||||
|
|
||||||
int pos = line.indexOf('=');
|
int pos = line.indexOf('=');
|
||||||
|
int end = line.lastIndexOf('#'); //comments, ignored lines
|
||||||
|
|
||||||
|
|
||||||
|
if (end == -1){ // If we have no hash sign, then we read till the end of the line
|
||||||
|
end = line.length();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (end <= pos){ // If hash is before the '=', we may have a issue... it should be fine, cause we check for issues next, but lets make sure.
|
||||||
|
end = line.length();
|
||||||
|
}
|
||||||
|
|
||||||
if (pos != -1) {
|
if (pos != -1) {
|
||||||
if (line.substring(0, pos).toLowerCase().equals("serverpath")) {
|
if (line.substring(0, pos).toLowerCase().equals("serverpath")) {
|
||||||
serverPath = line.substring(pos + 1, ignoreLine);
|
serverPath = line.substring(pos + 1, end);
|
||||||
} else if (line.substring(0, pos).toLowerCase().equals("java")) {
|
} else if (line.substring(0, pos).toLowerCase().equals("java")) {
|
||||||
javaLine = line.substring(pos + 1, ignoreLine);
|
javaLine = line.substring(pos + 1, end);
|
||||||
|
} else if (line.substring(0, pos).toLowerCase().equals("done_text")) {
|
||||||
|
doneText = line.substring(pos + 1, end);
|
||||||
|
} else if (line.substring(0, pos).toLowerCase().equals("preparing_text")) {
|
||||||
|
preparingText = line.substring(pos + 1, end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user