Minor Cleanup

This commit is contained in:
Morlok8k 2012-09-11 18:58:30 -07:00
parent 69d29c3b31
commit 0ab47fdd19
4 changed files with 16 additions and 19 deletions

View File

@ -457,7 +457,7 @@ public class Main {
} }
//TODO: make this optional //TODO: make this optional
boolean useChunks = false; final boolean useChunks = false;
if (useChunks) { // use Chunks or Regions if (useChunks) { // use Chunks or Regions
xRange = (int) (Math.ceil(((double) xRange) / ((double) 16))) * 16; //say xRange was entered as 1000. this changes it to be 1008, a multiple of 16. (the size of a chunk) xRange = (int) (Math.ceil(((double) xRange) / ((double) 16))) * 16; //say xRange was entered as 1000. this changes it to be 1008, a multiple of 16. (the size of a chunk)

View File

@ -2,6 +2,17 @@ package morlok8k.MinecraftLandGenerator;
public class Out { public class Out {
/**
* Outputs a formatted string to System.err as a line.
*
* @param str
* String to display and format
* @author Morlok8k
*/
public static void err(final String str) {
System.err.println(var.MLGe + str);
}
/** /**
* Outputs a formatted string to System.out as a line. * Outputs a formatted string to System.out as a line.
* *
@ -46,15 +57,4 @@ public class Out {
System.out.println("[Server] " + str); System.out.println("[Server] " + str);
} }
/**
* Outputs a formatted string to System.err as a line.
*
* @param str
* String to display and format
* @author Morlok8k
*/
public static void err(final String str) {
System.err.println(var.MLGe + str);
}
} }

View File

@ -22,7 +22,7 @@ public class Readme_and_HelpInfo {
String showHelpSTR = ""; String showHelpSTR = "";
String ReadMeText = ""; String ReadMeText = "";
String VersionInfo = ""; String VersionInfo = "";
String n = var.newLine; final String n = var.newLine;
//@formatter:off //@formatter:off
ReadMeText = PROG_NAME + " version " + VERSION + n ReadMeText = PROG_NAME + " version " + VERSION + n

View File

@ -295,8 +295,7 @@ public class Update {
if (pos != -1) { if (pos != -1) {
if (line.substring(0, pos).equals(var.MLG_Current_Hash)) { if (line.substring(0, pos).equals(var.MLG_Current_Hash)) {
var.MLG_Last_Modified_Long = var.MLG_Last_Modified_Long = new Long(line.substring(pos + 1, end));
new Long(line.substring(pos + 1, end));
var.MLG_Last_Modified_Date = new Date(var.MLG_Last_Modified_Long); var.MLG_Last_Modified_Date = new Date(var.MLG_Last_Modified_Long);
final Long highestModTime = final Long highestModTime =
@ -401,8 +400,7 @@ public class Update {
e1.printStackTrace(); e1.printStackTrace();
try { try {
Misc.copyFile(new File(var.MLG_JarFile), new File(var.MLG_JarFile Misc.copyFile(new File(var.MLG_JarFile), new File(var.MLG_JarFile + ".old"));
+ ".old"));
final File fileDelete = new File(var.MLG_JarFile); final File fileDelete = new File(var.MLG_JarFile);
fileDelete.delete(); fileDelete.delete();
} catch (final Exception e2) { } catch (final Exception e2) {
@ -414,8 +412,7 @@ public class Update {
} }
final boolean fileSuccess = final boolean fileSuccess = DownloadFile.downloadFile(var.github_MLG_jar_URL, true);
DownloadFile.downloadFile(var.github_MLG_jar_URL, true);
if (fileSuccess) { if (fileSuccess) {
Out.out(var.MLG_JarFile + " downloaded."); Out.out(var.MLG_JarFile + " downloaded.");
return; return;