1.4.4 - added ignore warning

This commit is contained in:
Morlok8k 2011-05-15 18:56:57 -07:00
parent 9eee4aa00c
commit 9fb2cba70e
2 changed files with 31 additions and 21 deletions

Binary file not shown.

View File

@ -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.3"; private static final String VERSION = "1.4.4";
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");
@ -63,6 +63,8 @@ public class Main {
private Integer yOffset = null; private Integer yOffset = null;
private boolean verbose = false; private boolean verbose = false;
private boolean alternate = false; private boolean alternate = false;
private static boolean ignoreWarnings = false;
/** /**
* @param args the command line arguments * @param args the command line arguments
@ -91,6 +93,7 @@ public class Main {
System.out.println("Switches:"); System.out.println("Switches:");
System.out.println(" -verbose : causes the application to output the server's messages to the console"); System.out.println(" -verbose : causes the application to output the server's messages to the console");
System.out.println(" -v : same as -verbose"); System.out.println(" -v : same as -verbose");
System.out.println(" -w : Ignore [WARNING] and [SEVERE] messages.");
//System.out.println(" -alt : alternate server launch sequence"); //System.out.println(" -alt : alternate server launch sequence");
//System.out.println(" -a : same as -alt"); //System.out.println(" -a : same as -alt");
System.out.println(" -i# : override the iteration spawn offset increment (default 300) (example: -i100)"); System.out.println(" -i# : override the iteration spawn offset increment (default 300) (example: -i100)");
@ -258,6 +261,8 @@ public class Main {
verbose = true; verbose = true;
} else if (nextSwitch.startsWith("-i")) { } else if (nextSwitch.startsWith("-i")) {
increment = Integer.parseInt(args[i + 2].substring(2)); increment = Integer.parseInt(args[i + 2].substring(2));
} else if (nextSwitch.startsWith("-w")) {
ignoreWarnings = true;
} else if (nextSwitch.equals("-alt") || nextSwitch.equals("-a")) { } else if (nextSwitch.equals("-alt") || nextSwitch.equals("-a")) {
// System.out.println("Using Alternate Launching..."); // System.out.println("Using Alternate Launching...");
System.out.println("Alternate Launch Disabled."); System.out.println("Alternate Launch Disabled.");
@ -478,8 +483,11 @@ public class Main {
// This is our map of data. It is an unmodifiable map, for some reason, so we have to make a copy. // This is our map of data. It is an unmodifiable map, for some reason, so we have to make a copy.
Map<String, Tag> newData = new LinkedHashMap<String, Tag>(originalData); Map<String, Tag> newData = new LinkedHashMap<String, Tag>(originalData);
// .get() a couple of values, just to make sure we're dealing with a valid level file, here. Good for debugging, too. // .get() a couple of values, just to make sure we're dealing with a valid level file, here. Good for debugging, too.
@SuppressWarnings("unused")
IntTag spawnX = (IntTag) newData.get("SpawnX"); //we never use these... IntTag spawnX = (IntTag) newData.get("SpawnX"); //we never use these...
IntTag spawnY = (IntTag) newData.get("SpawnY"); @SuppressWarnings("unused")
IntTag spawnY = (IntTag) newData.get("SpawnY"); //but whatever...
@SuppressWarnings("unused")
IntTag spawnZ = (IntTag) newData.get("SpawnZ"); IntTag spawnZ = (IntTag) newData.get("SpawnZ");
newData.put("SpawnX", new IntTag("SpawnX", x)); newData.put("SpawnX", new IntTag("SpawnX", x));
newData.put("SpawnY", new IntTag("SpawnY", y)); newData.put("SpawnY", new IntTag("SpawnY", y));
@ -598,6 +606,7 @@ public class Main {
outputStream.flush(); outputStream.flush();
outputStream.close(); outputStream.close();
} }
if (ignoreWarnings == false) {
if (line.contains("[WARNING]")) { //If we have a severe error, stop... if (line.contains("[WARNING]")) { //If we have a severe error, stop...
System.out.println(""); System.out.println("");
System.out.println("Warning found: Stopping Minecraft Land Generator"); System.out.println("Warning found: Stopping Minecraft Land Generator");
@ -619,6 +628,7 @@ public class Main {
//Quit! //Quit!
} }
} }
}
if (warning == true){ if (warning == true){
System.exit(1); System.exit(1);