1.7.0 almost done
This commit is contained in:
parent
cdf14f9f4f
commit
fc3a2121b9
@ -32,6 +32,7 @@ public class MLG_Server {
|
|||||||
Main.out("Alternate Launch");
|
Main.out("Alternate Launch");
|
||||||
Process process = Main.minecraft.start();
|
Process process = Main.minecraft.start();
|
||||||
|
|
||||||
|
//byte[] saveAll = { 's', 'a', 'v', 'e', '-', 'a', 'l', 'l', '\r', '\n' };
|
||||||
byte[] stop = { 's', 't', 'o', 'p', '\r', '\n' };
|
byte[] stop = { 's', 't', 'o', 'p', '\r', '\n' };
|
||||||
|
|
||||||
// monitor output and print to console where required.
|
// monitor output and print to console where required.
|
||||||
@ -39,9 +40,7 @@ public class MLG_Server {
|
|||||||
BufferedReader pOut =
|
BufferedReader pOut =
|
||||||
new BufferedReader(new InputStreamReader(process.getInputStream()));
|
new BufferedReader(new InputStreamReader(process.getInputStream()));
|
||||||
String line;
|
String line;
|
||||||
while ((line = pOut.readLine()) != null) { // readLine() returns null when the process exits
|
while ((line = pOut.readLine().trim()) != null) { // readLine() returns null when the process exits
|
||||||
|
|
||||||
line = line.trim(); //Trim spaces off the beginning and end, if any.
|
|
||||||
|
|
||||||
System.out.println(line);
|
System.out.println(line);
|
||||||
if (line.contains(Main.doneText)) { // EDITED By Morlok8k for Minecraft 1.3+ Beta
|
if (line.contains(Main.doneText)) { // EDITED By Morlok8k for Minecraft 1.3+ Beta
|
||||||
@ -82,9 +81,9 @@ public class MLG_Server {
|
|||||||
|
|
||||||
boolean convertedMapFormattingFlag = false; // This allows MLG to track if we converted a map to a new format (such as Chunk-file -> McRegion, or McRegion -> Anvil)
|
boolean convertedMapFormattingFlag = false; // This allows MLG to track if we converted a map to a new format (such as Chunk-file -> McRegion, or McRegion -> Anvil)
|
||||||
// just so it gets a line ending after the % output finishes
|
// just so it gets a line ending after the % output finishes
|
||||||
while ((line = pOut.readLine()) != null) { // readLine() returns null when the process exits
|
while ((line = pOut.readLine().trim()) != null) { // readLine() returns null when the process exits
|
||||||
|
|
||||||
int posBracket = line.lastIndexOf("]");
|
int posBracket = line.indexOf("]"); //changed from .lastIndexOf to .indexOf, in case we have a custom server that outputs something with an "]". we want the first one anyways.
|
||||||
if (posBracket != -1) {
|
if (posBracket != -1) {
|
||||||
shortLine = line.substring(posBracket + 2);
|
shortLine = line.substring(posBracket + 2);
|
||||||
shortLine = shortLine.trim();
|
shortLine = shortLine.trim();
|
||||||
@ -92,8 +91,6 @@ public class MLG_Server {
|
|||||||
shortLine = line;
|
shortLine = line;
|
||||||
}
|
}
|
||||||
|
|
||||||
line = line.trim();
|
|
||||||
|
|
||||||
if (Main.verbose) {
|
if (Main.verbose) {
|
||||||
Main.outS(shortLine);
|
Main.outS(shortLine);
|
||||||
//} else if (line.toLowerCase().contains("saving")) { //this was just clutter
|
//} else if (line.toLowerCase().contains("saving")) { //this was just clutter
|
||||||
|
@ -139,7 +139,7 @@ public class Main {
|
|||||||
|
|
||||||
private static Boolean recheckFlag = false;
|
private static Boolean recheckFlag = false;
|
||||||
private static long startTime = 0L;
|
private static long startTime = 0L;
|
||||||
private static boolean webLaunch = true; // Launch website after generation.
|
public static boolean webLaunch = true; // Launch website after generation.
|
||||||
|
|
||||||
private static boolean assertsEnabled = false; //debugging use... use java -ea -jar MinecraftlandGenerator.jar...
|
private static boolean assertsEnabled = false; //debugging use... use java -ea -jar MinecraftlandGenerator.jar...
|
||||||
|
|
||||||
@ -800,12 +800,17 @@ public class Main {
|
|||||||
|
|
||||||
if (webLaunch && java.awt.Desktop.isDesktopSupported()) {
|
if (webLaunch && java.awt.Desktop.isDesktopSupported()) {
|
||||||
URI splashPage =
|
URI splashPage =
|
||||||
URI.create("https://sites.google.com/site/minecraftlandgenerator/home/mlg_splash");
|
//URI.create("https://sites.google.com/site/minecraftlandgenerator/home/mlg_splash");
|
||||||
|
URI.create("http://adf.ly/520855/splashbanner");
|
||||||
try {
|
try {
|
||||||
java.awt.Desktop.getDesktop().browse(splashPage);
|
java.awt.Desktop.getDesktop().browse(splashPage);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
err("Error displaying webpage... " + e.getLocalizedMessage());
|
err("Error displaying webpage... " + e.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
out("Please Visit: http://adf.ly/520855/mlg");
|
||||||
|
out("Or: https://sites.google.com/site/minecraftlandgenerator/");
|
||||||
|
out("Thanks!");
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
@ -144,6 +144,12 @@ public class MLG_FileRead {
|
|||||||
} else {
|
} else {
|
||||||
Main.waitSave = false;
|
Main.waitSave = false;
|
||||||
}
|
}
|
||||||
|
} else if (property.equals("weblaunch")) {
|
||||||
|
if (value.toLowerCase().equals("true")) {
|
||||||
|
Main.webLaunch = true;
|
||||||
|
} else {
|
||||||
|
Main.webLaunch = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -167,6 +173,7 @@ public class MLG_FileRead {
|
|||||||
Main.outD(" level_8: " + Main.level_8);
|
Main.outD(" level_8: " + Main.level_8);
|
||||||
Main.outD(" level_9: " + Main.level_9);
|
Main.outD(" level_9: " + Main.level_9);
|
||||||
Main.outD(" waitSave: " + Main.waitSave);
|
Main.outD(" waitSave: " + Main.waitSave);
|
||||||
|
Main.outD(" webLaunch: " + Main.webLaunch);
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException ex) {
|
} catch (FileNotFoundException ex) {
|
||||||
Main.out("Could not find "
|
Main.out("Could not find "
|
||||||
|
@ -111,7 +111,9 @@ public class MLG_FileWrite {
|
|||||||
+ "Level-8=Level 8 (Future Level)" + Main.newLine
|
+ "Level-8=Level 8 (Future Level)" + Main.newLine
|
||||||
+ "Level-9=Level 9 (Future Level)" + Main.newLine
|
+ "Level-9=Level 9 (Future Level)" + Main.newLine
|
||||||
+ Main.newLine
|
+ Main.newLine
|
||||||
+ "#Optional: Wait a few seconds after saving." + Main.newLine + "WaitSave=false";
|
+ "#Optional: Wait a few seconds after saving." + Main.newLine
|
||||||
|
+ "WaitSave=false" + Main.newLine
|
||||||
|
+ "webLaunch=true";
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
|
|
||||||
writeTxtFile(Main.MinecraftLandGeneratorConf, txt);
|
writeTxtFile(Main.MinecraftLandGeneratorConf, txt);
|
||||||
|
@ -76,7 +76,8 @@ public class MLG_Readme_and_HelpInfo {
|
|||||||
+ " (To do this, I needed to rewrite the Main loop of the program, and add my own Coordinate object)" + newLine
|
+ " (To do this, I needed to rewrite the Main loop of the program, and add my own Coordinate object)" + newLine
|
||||||
+ "- Added Resume Functionality" + newLine
|
+ "- Added Resume Functionality" + newLine
|
||||||
+ "- Updated Time Output yet again." + newLine
|
+ "- Updated Time Output yet again." + newLine
|
||||||
+ "- Misc. Tweaks." + newLine
|
+ "- Made xx% output nicer by rewriting previous existing line." + newLine
|
||||||
|
+ "- Misc. Tweaks" + newLine
|
||||||
+ "- Misc. Additions" + newLine
|
+ "- Misc. Additions" + newLine
|
||||||
+ "1.6.3" + newLine
|
+ "1.6.3" + newLine
|
||||||
+ "- Minor Code Optimization" + newLine
|
+ "- Minor Code Optimization" + newLine
|
||||||
|
Reference in New Issue
Block a user