removed compile errors

This commit is contained in:
sommerlilie 2018-11-11 20:22:18 +01:00
parent 4729be6f38
commit b7e755d957
15 changed files with 399 additions and 315 deletions

341
.idea/workspace.xml generated
View File

@ -3,9 +3,20 @@
<component name="ChangeListManager">
<list default="true" id="6303f571-4608-4678-b04c-0c6cb20f921f" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/DownloadFile.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/DownloadFile.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/MLG-BuildID" beforeDir="false" afterPath="$PROJECT_DIR$/MLG-BuildID" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Coordinates.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Coordinates.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/FileWrite.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/FileWrite.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/GUI/MLG_GUI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/GUI/MLG_GUI.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/GUI/Start.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/GUI/Start.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Input_CLI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Input_CLI.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Main.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Misc.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Misc.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Server.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Server.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Setup.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Setup.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/SpawnPoint.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/SpawnPoint.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Startup.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Startup.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Time.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Time.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Update.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Update.java" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/bin/" />
<ignored path="$PROJECT_DIR$/target/" />
@ -19,40 +30,40 @@
<session id="-324306844">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.closed" value="9" />
<entry key="project.closed" value="11" />
<entry key="project.open.time.1" value="1" />
<entry key="project.open.time.14" value="1" />
<entry key="project.open.time.16" value="1" />
<entry key="project.open.time.16" value="2" />
<entry key="project.open.time.2" value="2" />
<entry key="project.open.time.21" value="3" />
<entry key="project.open.time.3" value="1" />
<entry key="project.open.time.4" value="1" />
<entry key="project.opened" value="10" />
<entry key="project.open.time.4" value="2" />
<entry key="project.opened" value="12" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="0-SNAPSHOT" value="3" />
<entry key="java" value="64" />
<entry key="java" value="78" />
<entry key="xml" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="JAVA" value="64" />
<entry key="JAVA" value="78" />
<entry key="UML" value="3" />
<entry key="XML" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="java" value="616" />
<entry key="java" value="1519" />
<entry key="xml" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="JAVA" value="616" />
<entry key="JAVA" value="1519" />
<entry key="XML" value="1" />
</counts>
</usages-collector>
@ -63,8 +74,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="10340">
<caret line="507" column="48" selection-start-line="507" selection-start-column="48" selection-end-line="507" selection-end-column="48" />
<state relative-caret-position="171">
<caret line="505" column="47" selection-start-line="505" selection-start-column="41" selection-end-line="505" selection-end-column="47" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -72,10 +83,10 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/var.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="271">
<state relative-caret-position="-1914">
<caret line="169" column="31" selection-start-line="169" selection-start-column="25" selection-end-line="169" selection-end-column="31" />
</state>
</provider>
@ -84,8 +95,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Misc.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="103">
<caret line="48" column="29" selection-start-line="48" selection-start-column="29" selection-end-line="48" selection-end-column="29" />
<state relative-caret-position="82">
<caret line="36" column="59" selection-start-line="36" selection-start-column="59" selection-end-line="36" selection-end-column="59" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -93,35 +104,20 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/FileRead.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="271">
<caret line="35" column="13" selection-start-line="35" selection-start-column="13" selection-end-line="35" selection-end-column="13" />
<folding>
<element signature="e#0#6897#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/FileWrite.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="271">
<caret line="30" column="13" selection-start-line="30" selection-start-column="13" selection-end-line="30" selection-end-column="13" />
<folding>
<element signature="e#0#5088#0" expanded="true" />
</folding>
<state relative-caret-position="258">
<caret line="140" column="22" selection-start-line="140" selection-start-column="22" selection-end-line="140" selection-end-column="22" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Input_CLI.java">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Setup.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="31">
<caret line="25" column="13" selection-start-line="25" selection-start-column="13" selection-end-line="25" selection-end-column="13" />
<state relative-caret-position="2524">
<caret line="148" column="28" selection-start-line="148" selection-start-column="28" selection-end-line="148" selection-end-column="28" />
</state>
</provider>
</entry>
@ -129,8 +125,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Coordinates.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2851">
<caret line="33" column="35" selection-start-line="33" selection-start-column="35" selection-end-line="33" selection-end-column="35" />
<state relative-caret-position="171">
<caret line="35" column="41" selection-start-line="35" selection-start-column="30" selection-end-line="35" selection-end-column="41" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -141,8 +137,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/SpawnPoint.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="207">
<caret line="63" column="65" selection-start-line="63" selection-start-column="65" selection-end-line="63" selection-end-column="65" />
<state relative-caret-position="192">
<caret line="63" column="65" lean-forward="true" selection-start-line="63" selection-start-column="65" selection-end-line="63" selection-end-column="65" />
</state>
</provider>
</entry>
@ -150,7 +146,7 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Readme_and_HelpInfo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-7185">
<state relative-caret-position="440">
<caret line="38" selection-start-line="38" selection-end-line="38" />
<folding>
<element signature="imports" expanded="true" />
@ -159,11 +155,20 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/DownloadFile.java">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Update.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1035">
<caret line="116" column="18" selection-start-line="116" selection-start-column="18" selection-end-line="116" selection-end-column="18" />
<state relative-caret-position="1086">
<caret line="513" column="28" selection-start-line="513" selection-start-column="28" selection-end-line="513" selection-end-column="28" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Time.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="108" column="20" selection-start-line="108" selection-start-column="20" selection-end-line="108" selection-end-column="20" />
</state>
</provider>
</entry>
@ -188,8 +193,6 @@
<find>Out.outD</find>
<find>waitTen</find>
<find>time</find>
<find>Out.out</find>
<find>parseString</find>
<find>doneTe</find>
<find>start</find>
<find>worldpa</find>
@ -198,11 +201,15 @@
<find>worldp</find>
<find>worldpath</find>
<find>size</find>
<find>Out.out</find>
<find>parseString</find>
<find>Coordi</find>
<find>Out.err</find>
</findStrings>
<replaceStrings>
<replace>log.error</replace>
<replace>log.debug</replace>
<replace>log.info</replace>
<replace>log.error</replace>
</replaceStrings>
</component>
<component name="Git.Settings">
@ -220,15 +227,24 @@
<list>
<option value="$PROJECT_DIR$/pom.xml" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Out.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Coordinates.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Test.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Time.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/FileRead.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Readme_and_HelpInfo.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Arraylist.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Misc.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Main.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/DownloadFile.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Main.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/GUI/Start.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/FileWrite.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Input_CLI.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Server.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Setup.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Startup.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Update.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/GUI/MLG_GUI.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Misc.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/SpawnPoint.java" />
<option value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Coordinates.java" />
</list>
</option>
</component>
@ -325,18 +341,26 @@
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="MinecraftLandGenerator" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="MinecraftLandGenerator" type="b2602c69:ProjectViewProjectNode" />
<item name="MinecraftLandGenerator" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="462c0819:PsiDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" />
<item name="GUI" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="PackagesPane" />
<pane id="Scope" />
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../Uni/Software-Engineering" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../semester-3/Software Engineering/Übungen/ex02" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="project.structure.last.edited" value="Modules" />
@ -356,7 +380,20 @@
</list>
</option>
</component>
<component name="RunManager" selected="Cucumber java.All Features in: MinecraftLandGenerator">
<component name="RunManager" selected="Application.Main">
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="morlok8k.MinecraftLandGenerator.Main" />
<module name="MinecraftLandGenerator" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="morlok8k.MinecraftLandGenerator.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="All Features in: MinecraftLandGenerator" type="CucumberJavaRunConfigurationType" factoryName="Cucumber java" temporary="true" nameIsGenerated="true">
<option name="CUCUMBER_CORE_VERSION" value="3" />
<option name="FILE_PATH" value="$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator" />
@ -394,9 +431,11 @@
<list>
<item itemvalue="Cucumber java.All Features in: src" />
<item itemvalue="Cucumber java.All Features in: MinecraftLandGenerator" />
<item itemvalue="Application.Main" />
</list>
<recent_temporary>
<list>
<item itemvalue="Application.Main" />
<item itemvalue="Cucumber java.All Features in: MinecraftLandGenerator" />
<item itemvalue="Cucumber java.All Features in: src" />
</list>
@ -421,7 +460,9 @@
<workItem from="1540806796932" duration="158000" />
<workItem from="1540807136481" duration="9000" />
<workItem from="1540807984018" duration="640000" />
<workItem from="1541147215780" duration="3990000" />
<workItem from="1541147215780" duration="4603000" />
<workItem from="1541424668898" duration="45000" />
<workItem from="1541864532203" duration="4577000" />
</task>
<servers />
</component>
@ -432,22 +473,28 @@
<history-entry file="All_Features_in__MinecraftLandGenerator - 2018.10.26 at 13h 44m 25s.xml">
<configuration name="All Features in: MinecraftLandGenerator" configurationId="CucumberJavaRunConfigurationType" />
</history-entry>
<history-entry file="All_Features_in__MinecraftLandGenerator - 2018.11.10 at 16h 56m 26s.xml">
<configuration name="All Features in: MinecraftLandGenerator" configurationId="CucumberJavaRunConfigurationType" />
</history-entry>
<history-entry file="All_Features_in__MinecraftLandGenerator - 2018.11.10 at 16h 56m 37s.xml">
<configuration name="All Features in: MinecraftLandGenerator" configurationId="CucumberJavaRunConfigurationType" />
</history-entry>
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="21545000" />
<option name="totallyTimeSpent" value="26780000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="28" width="1920" height="1052" extended-state="6" />
<editor active="true" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.17307693" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.17735043" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Designer" order="2" />
<window_info id="UI Designer" order="3" />
<window_info id="Favorites" order="4" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.30601093" />
<window_info anchor="bottom" id="Run" order="2" weight="0.32896176" />
<window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.32896176" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@ -563,13 +610,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/GUI/Start.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="770">
<caret line="53" column="50" selection-start-line="53" selection-start-column="50" selection-end-line="53" selection-end-column="50" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Test.java" />
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Out.java">
<provider selected="true" editor-type-id="text-editor">
@ -578,13 +618,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Time.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="108" column="20" selection-start-line="108" selection-start-column="20" selection-end-line="108" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/SelfAware.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
@ -592,27 +625,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Server.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
<caret line="18" column="13" selection-start-line="18" selection-start-column="13" selection-end-line="18" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Startup.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="286">
<caret line="36" column="13" selection-start-line="36" selection-start-column="13" selection-end-line="36" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Update.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
<caret line="41" column="13" selection-start-line="41" selection-start-column="13" selection-end-line="41" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/MD5.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
@ -627,13 +639,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Setup.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="23">
<caret line="33" column="13" selection-start-line="33" selection-start-column="13" selection-end-line="33" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/StringArrayParse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="176">
@ -641,19 +646,9 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/FileWrite.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="271">
<caret line="30" column="13" selection-start-line="30" selection-start-column="13" selection-end-line="30" selection-end-column="13" />
<folding>
<element signature="e#0#5088#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/FileRead.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="271">
<state relative-caret-position="220">
<caret line="35" column="13" selection-start-line="35" selection-start-column="13" selection-end-line="35" selection-end-column="13" />
<folding>
<element signature="e#0#6897#0" expanded="true" />
@ -661,51 +656,75 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Misc.java">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/DownloadFile.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="103">
<caret line="48" column="29" selection-start-line="48" selection-start-column="29" selection-end-line="48" selection-end-column="29" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<state relative-caret-position="1958">
<caret line="116" column="18" selection-start-line="116" selection-start-column="18" selection-end-line="116" selection-end-column="18" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/var.java">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/GUI/Start.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="271">
<caret line="169" column="31" selection-start-line="169" selection-start-column="25" selection-end-line="169" selection-end-column="31" />
<state relative-caret-position="181">
<caret line="90" column="9" lean-forward="true" selection-start-line="90" selection-start-column="9" selection-end-line="90" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/SpawnPoint.java">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Server.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="207">
<caret line="63" column="65" selection-start-line="63" selection-start-column="65" selection-end-line="63" selection-end-column="65" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Readme_and_HelpInfo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-7185">
<caret line="38" selection-start-line="38" selection-end-line="38" />
<folding>
<element signature="imports" expanded="true" />
</folding>
<state relative-caret-position="470">
<caret line="326" lean-forward="true" selection-start-line="326" selection-end-line="326" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Input_CLI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="31">
<caret line="25" column="13" selection-start-line="25" selection-start-column="13" selection-end-line="25" selection-end-column="13" />
<state relative-caret-position="308">
<caret line="52" column="21" selection-start-line="52" selection-start-column="21" selection-end-line="52" selection-end-column="21" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Main.java">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Startup.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="10340">
<caret line="507" column="48" selection-start-line="507" selection-start-column="48" selection-end-line="507" selection-end-column="48" />
<state relative-caret-position="148">
<caret line="318" column="22" selection-start-line="318" selection-start-column="22" selection-end-line="318" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/GUI/MLG_GUI.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-167">
<caret line="693" lean-forward="true" selection-start-line="693" selection-end-line="693" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Misc.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="82">
<caret line="36" column="59" selection-start-line="36" selection-start-column="59" selection-end-line="36" selection-end-column="59" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/SpawnPoint.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="192">
<caret line="63" column="65" lean-forward="true" selection-start-line="63" selection-start-column="65" selection-end-line="63" selection-end-column="65" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Readme_and_HelpInfo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="440">
<caret line="38" selection-start-line="38" selection-end-line="38" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -714,18 +733,56 @@
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Coordinates.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2851">
<caret line="33" column="35" selection-start-line="33" selection-start-column="35" selection-end-line="33" selection-end-column="35" />
<state relative-caret-position="171">
<caret line="35" column="41" selection-start-line="35" selection-start-column="30" selection-end-line="35" selection-end-column="41" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/DownloadFile.java">
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1035">
<caret line="116" column="18" selection-start-line="116" selection-start-column="18" selection-end-line="116" selection-end-column="18" />
<state relative-caret-position="171">
<caret line="505" column="47" selection-start-line="505" selection-start-column="41" selection-end-line="505" selection-end-column="47" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/FileWrite.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="258">
<caret line="140" column="22" selection-start-line="140" selection-start-column="22" selection-end-line="140" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Setup.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2524">
<caret line="148" column="28" selection-start-line="148" selection-start-column="28" selection-end-line="148" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Update.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1086">
<caret line="513" column="28" selection-start-line="513" selection-start-column="28" selection-end-line="513" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/Time.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="108" column="20" selection-start-line="108" selection-start-column="20" selection-end-line="108" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main/java/morlok8k/MinecraftLandGenerator/var.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1914">
<caret line="169" column="31" selection-start-line="169" selection-start-column="25" selection-end-line="169" selection-end-column="31" />
</state>
</provider>
</entry>

View File

@ -68,3 +68,4 @@ EC40B0ECC52B37571EE65F780994CEDE=1360299846000# MLG v1.7.3
2ADFF46BCF1E77A559E6D9DB9C7586E8=1381398906000# MLG v1.7.5
3223FFFEE274215C50C88372D79B9E5C=1421666774000# MLG v1.7.6
6BAC4CB261A1F7494D7B9802B7462121=1540554341000# MLG v1.7.7 (Class File, Not .Jar)
0706D1A8BCC148805EDAB29B7549B5A7=1541865384000# MLG v1.7.7 (Class File, Not .Jar)

View File

@ -9,6 +9,7 @@ package morlok8k.MinecraftLandGenerator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.*;
/**
* Coordinates are in the form of [X,Y,Z] or (X,Z)<br>
@ -31,6 +32,7 @@ public class Coordinates {
* @return
* @author Morlok8k
*/
public static Coordinates parseString(String StringOfCoords) {
//parse out string
StringOfCoords = StringOfCoords.trim();
@ -95,7 +97,7 @@ public class Coordinates {
/**
* Parses a Coordinates object from a String. Leading and trailing garbage is ignored.
*
*
* @param stringOfCoords
* A short- or long-form coordinate string as described at the two toString() methods
* @return
@ -137,7 +139,6 @@ public class Coordinates {
if (!matched) {
System.err.println("Invalid coordinate format: " + stringOfCoords);
System.err.println();
}
return new Coordinates(X, Y, Z);
}
@ -289,14 +290,14 @@ public class Coordinates {
// Because it doesn't know how to deal with my custom data.
// So instead of getting "blahblahblah.Coordinates@745f"
// (the location of the class and the hexstring of the hashcode)
// I return "[X,Y,Z]"
// I return "[X,Y,Z]"
return ("[" + X + "," + Y + "," + Z + "]");
}
/**
*
*
* @param Short
* @return
*/
@ -307,4 +308,9 @@ public class Coordinates {
return toString(); // Idiot catch. default to: "[X,Y,Z]"
}
public static Coordinates parse(String coords){
String [] splitted = coords.substring(1,coords.length()-2).trim().split(",");
return null;
}
}

View File

@ -19,6 +19,9 @@
package morlok8k.MinecraftLandGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
@ -30,6 +33,8 @@ import java.io.IOException;
*/
public class FileWrite {
private static Log log = LogFactory.getLog(Main.class);
/**
* http://www.roseindia.net/java/example/java/io/java-append-to-file.shtml <br>
* Append To File - Java Tutorial
@ -130,10 +135,10 @@ public class FileWrite {
outFile.write(txt);
outFile.newLine();
outFile.close();
Out.out(file + " file created.");
log.info(file + " file created.");
return;
} catch (final IOException ex) {
Out.err("Could not create " + var.MinecraftLandGeneratorConf + ".");
log.error("Could not create " + var.MinecraftLandGeneratorConf + ".");
ex.printStackTrace();
return;
}

View File

@ -51,9 +51,7 @@ import javax.swing.UIManager;
import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.plaf.metal.OceanTheme;
import morlok8k.MinecraftLandGenerator.Out;
import morlok8k.MinecraftLandGenerator.Startup;
import morlok8k.MinecraftLandGenerator.Time;
import morlok8k.MinecraftLandGenerator.Update;
import morlok8k.MinecraftLandGenerator.var;
@ -635,7 +633,7 @@ public class MLG_GUI {
final String title = var.PROG_NAME + " v" + var.VERSION;
//JOptionPane.showMessageDialog(frmMLG_GUI, message, title, JOptionPane.INFORMATION_MESSAGE);
Out.msg(message, title, JOptionPane.INFORMATION_MESSAGE);
System.out.println(message + title+ JOptionPane.INFORMATION_MESSAGE);
}
@ -693,7 +691,6 @@ public class MLG_GUI {
var.stoppingServerGUI = true;
Time.waitTenSec(true);
while (var.runningServerGUI) {
//;

View File

@ -19,7 +19,6 @@
package morlok8k.MinecraftLandGenerator.GUI;
import morlok8k.MinecraftLandGenerator.Time;
import morlok8k.MinecraftLandGenerator.var;
public class Start implements Runnable {
@ -89,7 +88,6 @@ public class Start implements Runnable {
while (var.stoppingServerGUI == false) {
// this is where we run the server loops!
MLG_GUI.frmMLG_GUI.repaint();
Time.waitTenSec(true);
}
}

View File

@ -19,12 +19,15 @@
package morlok8k.MinecraftLandGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
*
* @author morlok8k
*/
public class Input_CLI {
private static Log log = LogFactory.getLog(Main.class);
/**
* getInt(String msg) - outputs a message, will only accept a valid integer from keyboard
*
@ -35,18 +38,19 @@ public class Input_CLI {
*/
public static int getInt(final String msg) {
int Return = 0;
while (!(var.sc.hasNextInt())) {
var.sc.nextLine();
Out.outP(var.MLG + "Invalid Input. " + msg);
log.error(var.MLG + "Invalid Input. " + msg);
}
Return = var.sc.nextInt();
if (Return < 1000) {
Out.out("Input must be 1000 or larger.");
Out.outP(var.MLG + msg);
log.info("Input must be 1000 or larger.");
log.info(var.MLG + msg);
Return = getInt(msg);
}

View File

@ -205,7 +205,6 @@ public class Main {
log.info("Backing up level.dat to level_backup.dat.\n");
Misc.copyFile(serverLevel, backupLevel);
Files.copy()
final Coordinates spawn = SpawnPoint.getSpawn(serverLevel);
log.info("Spawn point detected: [X,Y,Z] " + spawn);

View File

@ -19,6 +19,9 @@
package morlok8k.MinecraftLandGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@ -31,6 +34,7 @@ import java.io.OutputStream;
* @author morlok8k
*/
public class Misc {
private static Log log = LogFactory.getLog(Main.class);
/**
* I'd love to use nio, but it requires Java 7.<br>
@ -80,10 +84,10 @@ public class Misc {
final File level = new File(var.worldPath + var.fileSeparator + "level.dat");
try {
final Coordinates spawn = SpawnPoint.getSpawn(level);
Out.out("The current spawn point is: [X,Y,Z] " + spawn);
log.info("The current spawn point is: [X,Y,Z] " + spawn);
return true;
} catch (final IOException ex) {
Out.err("Error while reading " + level.getPath());
log.error("Error while reading " + level.getPath());
return false;
}
}

View File

@ -7,6 +7,9 @@
package morlok8k.MinecraftLandGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@ -26,11 +29,12 @@ public class Server {
* @throws IOException
* @author Corrodias, Morlok8k
*/
private static Log log = LogFactory.getLog(Main.class);
protected static boolean runMinecraft() throws IOException {
if (var.verbose) {
Out.out("Starting server.");
log.info("Starting server.");
}
boolean serverSuccess = true;
boolean warning = false;
@ -41,7 +45,7 @@ public class Server {
// STOP the server when it's done.
if (var.alternate) { // Alternate - a replication (slightly stripped down) of MLG 1.3.0's code. simplest code possible.
Out.out("Alternate Launch");
log.info("Alternate Launch");
final Process process = var.minecraft.start();
final byte[] saveAll = { 's', 'a', 'v', 'e', '-', 'a', 'l', 'l', '\r', '\n' };
@ -60,7 +64,7 @@ public class Server {
if (line.contains(var.doneText)) { // EDITED By Morlok8k for Minecraft 1.3+ Beta
final OutputStream outputStream = process.getOutputStream();
Out.out("Stopping server... (Please Wait...)");
log.info("Stopping server... (Please Wait...)");
outputStream.write(saveAll);
outputStream.flush();
outputStream.write(stop);
@ -73,12 +77,12 @@ public class Server {
} else { // start minecraft server normally!
final Process process = var.minecraft.start();
if (var.verbose) {
Out.out("Started Server.");
log.info("Started Server.");
}
final BufferedReader pOut =
new BufferedReader(new InputStreamReader(process.getInputStream()));
if (var.verbose) {
Out.out("Accessing Server Output...");
log.info("Accessing Server Output...");
}
String line = null;
@ -118,7 +122,7 @@ public class Server {
}
if (var.verbose) {
Out.outS(shortLine);
log.info(shortLine);
//} else if (line.toLowerCase().contains("saving")) { //this was just clutter
// Main.outS(shortLine);
} else if (line.contains(var.preparingText) || line.contains("Converting...")) {
@ -135,11 +139,11 @@ public class Server {
outTmp = outTmp2;
if (prepTextFirst) {
Out.outP(var.MLG + outTmp + "...");
log.info(var.MLG + outTmp + "...");
prepTextFirst = false;
} else {
//Main.outP(" " + outTmp + "...");
Out.outP("\r" + var.MLG + outTmp + "..."); //here we use \r to go back to the previous line, and rewrite it
log.info("\r" + var.MLG + outTmp + "..."); //here we use \r to go back to the previous line, and rewrite it
}
//}
@ -148,44 +152,44 @@ public class Server {
prepTextFirst = true;
if (convertedMapFormattingFlag == true) {
Out.outP(var.newLine);
log.info(var.newLine);
convertedMapFormattingFlag = false;
}
if (line.contains("level 0")) { // "Preparing start region for level 0"
Out.outP(var.MLG + var.worldName + ": " + var.level_0 + ":" + var.newLine);
log.info(var.MLG + var.worldName + ": " + var.level_0 + ":" + var.newLine);
} else if (line.contains("level 1")) { // "Preparing start region for level 1"
Out.outP(var.newLine + var.MLG + var.worldName + ": " + var.level_1 + ":"
log.info(var.newLine + var.MLG + var.worldName + ": " + var.level_1 + ":"
+ var.newLine);
} else if (line.contains("level 2")) { // "Preparing start region for level 2"
Out.outP(var.newLine + var.MLG + var.worldName + ": " + var.level_2 + ":"
log.info(var.newLine + var.MLG + var.worldName + ": " + var.level_2 + ":"
+ var.newLine);
} else if (line.contains("level 3")) { // "Preparing start region for level 3"
Out.outP(var.newLine + var.MLG + var.worldName + ": " + var.level_3 + ":"
log.info(var.newLine + var.MLG + var.worldName + ": " + var.level_3 + ":"
+ var.newLine);
} else if (line.contains("level 4")) { // "Preparing start region for level 4"
Out.outP(var.newLine + var.MLG + var.worldName + ": " + var.level_4 + ":"
log.info(var.newLine + var.MLG + var.worldName + ": " + var.level_4 + ":"
+ var.newLine);
} else if (line.contains("level 5")) { // "Preparing start region for level 5"
Out.outP(var.newLine + var.MLG + var.worldName + ": " + var.level_5 + ":"
log.info(var.newLine + var.MLG + var.worldName + ": " + var.level_5 + ":"
+ var.newLine);
} else if (line.contains("level 6")) { // "Preparing start region for level 6"
Out.outP(var.newLine + var.MLG + var.worldName + ": " + var.level_6 + ":"
log.info(var.newLine + var.MLG + var.worldName + ": " + var.level_6 + ":"
+ var.newLine);
} else if (line.contains("level 7")) { // "Preparing start region for level 7"
Out.outP(var.newLine + var.MLG + var.worldName + ": " + var.level_7 + ":"
log.info(var.newLine + var.MLG + var.worldName + ": " + var.level_7 + ":"
+ var.newLine);
} else if (line.contains("level 8")) { // "Preparing start region for level 8"
Out.outP(var.newLine + var.MLG + var.worldName + ": " + var.level_8 + ":"
log.info(var.newLine + var.MLG + var.worldName + ": " + var.level_8 + ":"
+ var.newLine);
} else if (line.contains("level 9")) { // "Preparing start region for level 9"
Out.outP(var.newLine + var.MLG + var.worldName + ": " + var.level_9 + ":"
log.info(var.newLine + var.MLG + var.worldName + ": " + var.level_9 + ":"
+ var.newLine);
} else {
Out.outP(var.newLine + var.MLG + shortLine + var.newLine);
log.info(var.newLine + var.MLG + shortLine + var.newLine);
}
} else if (line.contains("server version") || line.contains("Converting map!")) { //TODO: add to .conf
Out.outS(shortLine);
log.info(shortLine);
if (line.contains("server version") && var.MC_Server_Version.isEmpty()) {
// if server version, save string to variable, for use in arraylist save file.
@ -196,14 +200,14 @@ public class Server {
if (line.contains(var.doneText)) { // now this is configurable!
Out.outP(var.newLine);
Out.outS(line.substring(line.lastIndexOf("]") + 2, line.indexOf("!")));
log.info(var.newLine);
log.info(line.substring(line.lastIndexOf("]") + 2, line.indexOf("!")));
if (var.waitSave) {
Out.out("Waiting 30 seconds to save...");
log.info("Waiting 30 seconds to save...");
int count = 1;
while (count <= 30) {
Out.outP(".");
log.info(".");
try {
Thread.sleep(1000);
@ -212,23 +216,23 @@ public class Server {
}
count += 1;
}
Out.out("");
log.info("");
}
Out.out("Saving server data...");
log.info("Saving server data...");
outputStream.write(saveAll);
outputStream.flush();
Out.out("Stopping server... (Please Wait...)");
log.info("Stopping server... (Please Wait...)");
// OutputStream outputStream = process.getOutputStream();
outputStream.write(stop);
outputStream.flush();
// outputStream.close();
if (var.waitSave) {
Out.out("Waiting 10 seconds to save.");
log.info("Waiting 10 seconds to save.");
int count = 1;
while (count <= 10) {
Out.outP(".");
log.info(".");
try {
Thread.sleep(1000);
@ -237,7 +241,7 @@ public class Server {
}
count += 1;
}
Out.out("");
log.info("");
}
}
@ -247,27 +251,27 @@ public class Server {
var.ignoreWarnings = true;
} else if (line.contains("[WARNING] To start the server with more ram")) {
if (var.verbose == false) { // If verbose is true, we already displayed it.
Out.outS(line);
log.info(line);
}
warningsWeCanIgnore = true; //we can safely ignore this...
var.ignoreWarnings = true;
} else if (line.contains("Error occurred during initialization of VM")
|| line.contains("Could not reserve enough space for object heap")) {
if (var.verbose == false) { // If verbose is true, we already displayed it.
Out.outP("[Java Error] " + line);
log.info("[Java Error] " + line);
}
warning = true;
}
if (var.ignoreWarnings == false) {
if (line.contains("[WARNING]")) { // If we have a warning, stop...
Out.out("");
Out.out("Warning found: Stopping " + var.PROG_NAME);
log.info("");
log.info("Warning found: Stopping " + var.PROG_NAME);
if (var.verbose == false) { // If verbose is true, we already displayed it.
Out.outS(line);
log.info(line);
}
Out.out("");
Out.out("Forcing Save...");
log.info("");
log.info("Forcing Save...");
outputStream.write(saveAll);
outputStream.flush();
// OutputStream outputStream = process.getOutputStream();
@ -280,13 +284,13 @@ public class Server {
// System.exit(1);
}
if (line.contains("[SEVERE]")) { // If we have a severe error, stop...
Out.out("");
Out.out("Severe error found: Stopping server.");
log.info("");
log.info("Severe error found: Stopping server.");
if (var.verbose == false) { // If verbose is true, we already displayed it.
Out.outS(line);
log.info(line);
}
Out.out("");
Out.out("Forcing Save...");
log.info("");
log.info("Forcing Save...");
outputStream.write(saveAll);
outputStream.flush();
// OutputStream outputStream = process.getOutputStream();

View File

@ -19,6 +19,9 @@
package morlok8k.MinecraftLandGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
@ -33,6 +36,8 @@ import java.io.IOException;
public class Setup {
private static Log log = LogFactory.getLog(Main.class);
static boolean doSetup() throws IOException {
final File serverPathFile;
final BufferedReader serverPropertiesFile;
@ -47,7 +52,7 @@ public class Setup {
/*FileNotFoundException fileException =
new FileNotFoundException("The server directory is invalid: " + var.serverPath);
throw fileException;*/
Out.err("The server directory is invalid: " + var.serverPath);
log.error("The server directory is invalid: " + var.serverPath);
return true;
}
@ -57,7 +62,7 @@ public class Setup {
new BufferedReader(new FileReader(new File(var.serverPath + var.fileSeparator
+ "server.properties")));
} catch (IOException e) {
Out.err("Could not open the server.properties file.");
log.error("Could not open the server.properties file.");
return true;
}
@ -95,7 +100,7 @@ public class Setup {
if (var.worldName == null) { // If after all this we still don't have a proper world name, stop everything and throw an exception
/*NullPointerException noNameException = new NullPointerException("There is no world name defined in the server.properties file!");
throw noNameException;*/
Out.err("There is no world name defined in the server.properties file!");
log.error("There is no world name defined in the server.properties file!");
return true;
}
@ -111,8 +116,8 @@ public class Setup {
if (levelDat.exists() && levelDat.isFile()) {
if (backupLevel.exists()) {
Out.err("There is a level_backup.dat file left over from a previous attempt that failed.");
Out.out("Resuming...");
log.error("There is a level_backup.dat file left over from a previous attempt that failed.");
log.info("Resuming...");
//use resume data
final File serverLevel = new File(var.worldPath + var.fileSeparator + "level.dat");
@ -136,19 +141,19 @@ public class Setup {
} else {
/*FileNotFoundException fileException =
new FileNotFoundException("The currently configured world does not exist.");*/
Out.err("The currently configured world does not exist! Launching the server once to create it...");
log.error("The currently configured world does not exist! Launching the server once to create it...");
try {
var.minecraft = new ProcessBuilder(var.javaLine.split("\\s")); // is this always going to work? i don't know. (most likely yes)
var.minecraft.directory(new File(var.serverPath));
var.minecraft.redirectErrorStream(true);
if (!(Server.runMinecraft())) {
Out.err("Huh oh! Something went wrong with the server! Exiting...");
log.error("Huh oh! Something went wrong with the server! Exiting...");
System.exit(1); // we got a warning or severe error
}
} catch (IOException e) {
return true;
}
Out.err("World created! Starting world generation...");
log.error("World created! Starting world generation...");
}
return false;
}

View File

@ -66,7 +66,7 @@ public class SpawnPoint {
final LongTag Seed = (LongTag) newData.get("RandomSeed");
var.randomSeed = Seed.getValue();
Out.out("Seed: " + var.randomSeed); // lets output the seed, cause why not?
System.out.println("Seed: " + var.randomSeed); // lets output the seed, cause why not?
final Coordinates ret =
new Coordinates(spawnX.getValue(), spawnY.getValue(), spawnZ.getValue());

View File

@ -19,6 +19,9 @@
package morlok8k.MinecraftLandGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
@ -35,6 +38,7 @@ import java.util.Date;
*
*/
public class Startup {
private static Log log = LogFactory.getLog(Main.class);
public static void initialStart() {
@ -44,15 +48,15 @@ public class Startup {
// The following displays no matter what happens, so we needed this date stuff to happen first.
Out.out(var.PROG_NAME + " version " + var.VERSION);
Out.out("BuildID: (" + var.MLG_Last_Modified_Date.getTime() + ")"); // instead of dateformatting the buildid, we return the raw Long number.
log.info(var.PROG_NAME + " version " + var.VERSION);
log.info("BuildID: (" + var.MLG_Last_Modified_Date.getTime() + ")"); // instead of dateformatting the buildid, we return the raw Long number.
// thus different timezones wont display a different buildID
Out.out("This version was last modified on "
log.info("This version was last modified on "
+ var.dateFormat.format(var.MLG_Last_Modified_Date));
Out.out("");
Out.out("Uses a Minecraft server to generate square land of a specified size.");
Out.out("");
Out.out("");
log.info("");
log.info("Uses a Minecraft server to generate square land of a specified size.");
log.info("");
log.info("");
}
@ -77,14 +81,14 @@ public class Startup {
if (!(var.args.equals(newArgs))) { //do the freshly parsed args match the original?
var.dontWait = true; //if not, we dont wait for anything!
var.args = newArgs; //use the freshly parsed args for everything else now...
Out.out("Notice: Not waiting for anything...");
log.info("Notice: Not waiting for anything...");
}
if (var.args.length == 0) { //we didn't find a an X and Z size, so lets ask for one.
Out.out("Please Enter the size of world you want. Example: X:1000 Z:1000");
Out.outP(var.MLG + "X:");
log.info("Please Enter the size of world you want. Example: X:1000 Z:1000");
log.info(var.MLG + "X:");
var.xRange = Input_CLI.getInt("X:");
Out.outP(var.MLG + "Z:");
log.info(var.MLG + "Z:");
var.zRange = Input_CLI.getInt("Z:");
var.args = new String[] { String.valueOf(var.xRange), String.valueOf(var.zRange) };
@ -110,7 +114,7 @@ public class Startup {
final boolean fileSuccess =
DownloadFile.downloadFile(var.github_MLG_Conf_URL, var.testing);
if (fileSuccess) {
Out.out(var.MinecraftLandGeneratorConf + " file downloaded.");
log.info(var.MinecraftLandGeneratorConf + " file downloaded.");
return true;
}
}
@ -123,14 +127,12 @@ public class Startup {
|| var.args[0].equalsIgnoreCase("-printspawn")) {
// okay, sorry, this is an ugly hack, but it's just a last-minute feature.
Misc.printSpawn();
Time.waitTenSec(false);
return true;
} else if (var.args[0].equalsIgnoreCase("-build")) {
Update.buildID(false);
return true;
} else if (var.args[0].equalsIgnoreCase("-update")) {
Update.updateMLG();
Time.waitTenSec(false);
return true;
} else if (var.args[0].equalsIgnoreCase("-readme")) {
@ -144,8 +146,7 @@ public class Startup {
if (var.args.length == 2) {
DownloadFile.downloadFile(var.args[1], true);
} else {
Out.out("No File to Download!");
Time.waitTenSec(false);
log.info("No File to Download!");
}
return true;
@ -198,22 +199,18 @@ public class Startup {
} catch (final FileNotFoundException ex) {
System.err.println(var.args[1] + " - File not found");
Time.waitTenSec(false);
return true;
} catch (final IOException ex) {
System.err.println(var.args[1] + " - Could not read file.");
Time.waitTenSec(false);
return true;
}
} else {
Out.out("No File with links!");
Time.waitTenSec(false);
log.info("No File with links!");
}
return true;
} else if (var.args.length == 1) {
Out.out("For help, use java -jar " + var.MLGFileNameShort + " -help");
Time.waitTenSec(false);
log.info("For help, use java -jar " + var.MLGFileNameShort + " -help");
return true;
}
@ -224,16 +221,16 @@ public class Startup {
if ((var.xRange < 1000) && (var.xRange != 0)) {
var.xRange = 1000; //if less than 1000, (and not 0) set to 1000 (Calculations don't work well on very small maps)
Out.err("X size too small - Changing X to 1000");
log.error("X size too small - Changing X to 1000");
}
if ((var.zRange < 1000) && (var.zRange != 0)) {
var.zRange = 1000;
Out.err("Z size too small - Changing Z to 1000");
log.error("Z size too small - Changing Z to 1000");
}
} catch (final NumberFormatException ex) {
Out.err("Invalid X or Z argument.");
Out.err("Please Enter the size of world you want. Example: X:1000 Z:1000");
log.error("Invalid X or Z argument.");
log.error("Please Enter the size of world you want. Example: X:1000 Z:1000");
var.xRange = Input_CLI.getInt("X:");
var.zRange = Input_CLI.getInt("Z:");
@ -246,43 +243,42 @@ public class Startup {
final String nextSwitch = var.args[i + 2].toLowerCase();
if (nextSwitch.equals("-verbose") || nextSwitch.equals("-v")) {
var.verbose = true;
Out.out("Notice: Verbose Mode");
log.info("Notice: Verbose Mode");
} else if (nextSwitch.startsWith("-i")) {
var.increment = Integer.parseInt(var.args[i + 2].substring(2));
Out.out("Notice: Non-Default Increment: " + var.increment);
log.info("Notice: Non-Default Increment: " + var.increment);
} else if (nextSwitch.startsWith("-w")) {
var.ignoreWarnings = true;
Out.out("Notice: Warnings from Server are Ignored");
log.info("Notice: Warnings from Server are Ignored");
} else if (nextSwitch.equals("-alt") || nextSwitch.equals("-a")) {
var.alternate = true;
Out.out("Notice: Using Alternate Launching");
log.info("Notice: Using Alternate Launching");
} else if (nextSwitch.equals("-chunk") || nextSwitch.equals("-c")) {
var.useChunks = true;
Out.out("Notice: Using Chunks instead of Regions");
log.info("Notice: Using Chunks instead of Regions");
} else if (nextSwitch.startsWith("-x")) {
var.xOffset = Integer.valueOf(var.args[i + 2].substring(2));
Out.out("Notice: X Offset: " + var.xOffset);
log.info("Notice: X Offset: " + var.xOffset);
} else if (nextSwitch.startsWith("-y") || nextSwitch.startsWith("-z")) { //NOTE: "-y" is just here for backwards compatibility
var.zOffset = Integer.valueOf(var.args[i + 2].substring(2));
Out.out("Notice: Z Offset: " + var.zOffset);
log.info("Notice: Z Offset: " + var.zOffset);
if (nextSwitch.startsWith("-y")) {
Out.out("Notice: MLG now uses Z instead of Y. Please use the -z switch instead");
Time.waitTenSec(false);
log.info("Notice: MLG now uses Z instead of Y. Please use the -z switch instead");
}
} else {
var.serverPath = var.args[i + 2];
Out.out("Notice: Attempting to use Alternate Server:" + var.serverPath);
log.info("Notice: Attempting to use Alternate Server:" + var.serverPath);
}
}
} catch (final NumberFormatException ex) {
Out.err("Invalid switch value.");
log.error("Invalid switch value.");
return true;
}
@ -295,7 +291,7 @@ public class Startup {
boolean oldConf = false; // This next section checks to see if we have a old configuration file (or none!)
if ((var.serverPath == null) || (var.javaLine == null)) { // MLG 1.2 Check for a valid .conf file.
Out.err(var.MinecraftLandGeneratorConf
log.error(var.MinecraftLandGeneratorConf
+ " does not contain all required properties. Making New File!"); // Please recreate it by running this application with -conf.
// return;
@ -320,11 +316,10 @@ public class Startup {
}
if (oldConf) {
Out.err("Old Version of " + var.MinecraftLandGeneratorConf + " found. Updating...");
log.error("Old Version of " + var.MinecraftLandGeneratorConf + " found. Updating...");
FileWrite.saveConf(false); //old conf
Time.waitTenSec(false);
return true;
}

View File

@ -114,13 +114,13 @@ public class Time {
if (var.dontWait) { return; } //Don't wait!
if (output) {
Out.outP(var.MLG); //here we wait 10 sec.
log.infoP(var.MLG); //here we wait 10 sec.
}
int count = 0;
while (count <= 100) {
if (output) {
Out.outP(count + "% ");
log.infoP(count + "% ");
}
try {
@ -131,7 +131,7 @@ public class Time {
count += 10;
}
if (output) {
Out.outP(var.newLine);
log.infoP(var.newLine);
}
return;

View File

@ -19,6 +19,9 @@
package morlok8k.MinecraftLandGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
@ -36,7 +39,6 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
/**
*
* @author morlok8k
*/
public class Update {
@ -51,25 +53,30 @@ public class Update {
* computer will have the correct time stamp. (or possibly a copy from the original computer)<br>
* <br>
* This saves the hash and the timestamp (now known as the BuildID)
*
*
* @param downloadOnly
* @author Morlok8k
*/
private static Log log = LogFactory.getLog(Main.class);
public static void buildID(final boolean downloadOnly) {
// download BuildID from Github.
final boolean fileSuccess =
DownloadFile.downloadFile(var.github_MLG_BuildID_URL, var.testing);
if (fileSuccess) {
Out.out(var.buildIDFile + " file downloaded.");
log.info(var.buildIDFile + " file downloaded.");
var.flag_downloadedBuildID = true;
if (downloadOnly) { return; }
if (downloadOnly) {
return;
}
}
if (downloadOnly) {
Out.err("Couldn't Download new " + var.buildIDFile);
log.error("Couldn't Download new " + var.buildIDFile);
return;
}
@ -80,10 +87,12 @@ public class Update {
try {
var.MLGFileName = getClassLoader(var.cls);
} catch (final Exception e) {
Out.out("Error: Finding file failed");
log.info("Error: Finding file failed");
e.printStackTrace();
}
if (var.MLGFileName.equals(var.rsrcError)) { return; }
if (var.MLGFileName.equals(var.rsrcError)) {
return;
}
}
if (var.MLG_Current_Hash == null) {
@ -92,7 +101,7 @@ public class Update {
var.MLG_Current_Hash = MD5.fileMD5(var.MLGFileName);
// out(hash + " " + MLGFileName);
} catch (final Exception e) {
Out.out("Error: MD5 from file failed");
log.info("Error: MD5 from file failed");
e.printStackTrace();
}
}
@ -102,7 +111,7 @@ public class Update {
try {
time = getCompileTimeStamp(var.cls);
} catch (final Exception e) {
Out.out("Error: TimeStamp from file failed");
log.info("Error: TimeStamp from file failed");
e.printStackTrace();
}
// out(d.toString());
@ -125,7 +134,7 @@ public class Update {
if (line.contains(var.MLG_Current_Hash)) {
notNew = true;
if (var.testing) {
Out.outD("NotNew");
log.info("NotNew");
}
}
@ -147,7 +156,7 @@ public class Update {
fileRename.renameTo(new File(var.buildIDFile));
} catch (final FileNotFoundException ex) {
Out.out("\"" + var.buildIDFile + "\" file not Found. Generating New \""
log.info("\"" + var.buildIDFile + "\" file not Found. Generating New \""
+ var.buildIDFile + "\" File");
FileWrite.writeTxtFile(var.buildIDFile,
@ -155,7 +164,7 @@ public class Update {
+ var.VERSION + INFO);
} catch (final IOException ex) {
Out.err("Could not create \"" + var.buildIDFile + "\".");
log.error("Could not create \"" + var.buildIDFile + "\".");
return;
}
@ -163,7 +172,7 @@ public class Update {
/**
* This gets the filename of a .jar (typically this one!)
*
*
* @param classFile
* @return
* @throws IOException
@ -179,19 +188,19 @@ public class Update {
// out(filename);
// START Garbage removal:
int bang = filename.indexOf("!"); // remove everything after xxxx.jar
if (bang == -1) { // a real example:
bang = filename.length(); // jar:file:/home/morlok8k/test.jar!/me/Morlok8k/test/Main.class
int bang = filename.indexOf("!"); // remove everything after xxxx.jar
if (bang == -1) { // a real example:
bang = filename.length(); // jar:file:/home/morlok8k/test.jar!/me/Morlok8k/test/Main.class
}
int file = filename.indexOf("file:"); // removes junk from the beginning of the path
int file = filename.indexOf("file:"); // removes junk from the beginning of the path
file = file + 5;
if (file == -1) {
file = 0;
}
if (filename.contains("rsrc:")) {
Out.err("THIS WAS COMPILED USING \"org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader\"! ");
Out.err("DO NOT PACKAGE YOUR .JAR'S WITH THIS CLASSLOADER CODE!");
Out.err("(Your Libraries need to be extracted.)");
log.error("THIS WAS COMPILED USING \"org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader\"! ");
log.error("DO NOT PACKAGE YOUR .JAR'S WITH THIS CLASSLOADER CODE!");
log.error("(Your Libraries need to be extracted.)");
return var.rsrcError;
}
if (filename.contains(".jar")) {
@ -208,7 +217,7 @@ public class Update {
* <br>
* Thanks to Roedy Green at <br>
* <a href="http://mindprod.com/jgloss/compiletimestamp.html">http://mindprod .com/jgloss/compiletimestamp.html</a>
*
*
* @param classFile
* @return
* @throws IOException
@ -231,9 +240,8 @@ public class Update {
/**
* Gets the BuildID for MLG
*
*
* @author Morlok8k
*
*/
public static void readBuildID() {
@ -241,16 +249,18 @@ public class Update {
var.MLG_Last_Modified_Date = new Date(new Long(0)); //set the day to Jan 1, 1970 for failure
return;
}
var.inf_loop_protect_BuildID++; // this is to prevent an infinite loop (however unlikely)
var.inf_loop_protect_BuildID++; // this is to prevent an infinite loop (however unlikely)
if (var.MLGFileName == null) {
try {
var.MLGFileName = getClassLoader(var.cls);
} catch (final Exception e) {
Out.out("Error: Finding file failed");
log.info("Error: Finding file failed");
e.printStackTrace();
}
if (var.MLGFileName.equals(var.rsrcError)) { return; }
if (var.MLGFileName.equals(var.rsrcError)) {
return;
}
}
var.MLGFileNameShort =
@ -258,7 +268,7 @@ public class Update {
var.MLGFileName.length());
if (var.testing) {
Out.outD("Currently Running as file:" + var.MLGFileNameShort);
log.info("Currently Running as file:" + var.MLGFileNameShort);
}
if (var.MLG_Current_Hash == null) {
@ -267,7 +277,7 @@ public class Update {
var.MLG_Current_Hash = MD5.fileMD5(var.MLGFileName);
// out(hash + " " + MLGFileName);
} catch (final Exception e) {
Out.out("Error: MD5 from file failed");
log.info("Error: MD5 from file failed");
e.printStackTrace();
}
}
@ -283,7 +293,7 @@ public class Update {
String line;
if (var.testing) {
Out.outD("TimeStamps in buildIDFile:");
log.info("TimeStamps in buildIDFile:");
}
while ((line = in.readLine()) != null) {
@ -300,7 +310,7 @@ public class Update {
pos = -1;
}
if (end == 0) { //hash is first char, meaning entire line is a comment
if (end == 0) { //hash is first char, meaning entire line is a comment
end = line.length();
pos = 0;
}
@ -314,7 +324,7 @@ public class Update {
//timeStamps.add(line.substring(pos + 1, end));
if (var.testing) {
Out.outD(var.timeStamps.get(tsCount));
log.info(var.timeStamps.get(tsCount));
}
tsCount++;
@ -333,38 +343,38 @@ public class Update {
final long tCalc = var.MLG_Last_Modified_Long - highestModTime;
if (var.testing) {
Out.outD("tCalc\tMLG_Last_Modified_Long\thighestModTime"
log.info("tCalc\tMLG_Last_Modified_Long\thighestModTime"
+ var.newLine + tCalc + "\t"
+ var.MLG_Last_Modified_Long + "\t" + highestModTime);
}
if (highestModTime == 0L) {
Out.err("Archive Intergrity Check Failed: .zip/.jar file Issue.");
Out.err("Archive Intergrity Check Failed: (MLG will still run. Just note that this may not be an official version.)");
log.error("Archive Intergrity Check Failed: .zip/.jar file Issue.");
log.error("Archive Intergrity Check Failed: (MLG will still run. Just note that this may not be an official version.)");
} else {
if (tCalc < -43200000L) {
//time is newer? (.zip file is newer than BuildID)
Out.err("Archive Intergrity Check Failed: .zip file is newer than BuildID. Offset: "
log.error("Archive Intergrity Check Failed: .zip file is newer than BuildID. Offset: "
+ (tCalc / 1000) + "sec.");
Out.err("Archive Intergrity Check Failed: (MLG will still run. Just note that this may not be an official version.)");
log.error("Archive Intergrity Check Failed: (MLG will still run. Just note that this may not be an official version.)");
}
if (tCalc < 43200000L) {
//times are within 24 hours (+/- 12 hours) of each other. (typically 1-2 seconds, but left room for real-world error - due to timezone bugs with some operating systems)
if (var.testing | var.flag_downloadedBuildID) {
Out.out("Archive Intergrity Check Passed. Offset: "
log.info("Archive Intergrity Check Passed. Offset: "
+ (tCalc / 1000) + "sec.");
}
} else {
//times dont match. (.zip file is older than specified BuildID)
Out.err("Archive Intergrity Check Failed: .zip file is older than BuildID. Offset: "
log.error("Archive Intergrity Check Failed: .zip file is older than BuildID. Offset: "
+ (tCalc / 1000) + "sec.");
Out.err("Archive Intergrity Check Failed: (MLG will still run. Just note that this may not be an official version.)");
log.error("Archive Intergrity Check Failed: (MLG will still run. Just note that this may not be an official version.)");
}
}
//return;
@ -379,13 +389,13 @@ public class Update {
if (foundLine == false) {
// out("[DEBUG] FoundLine False");
buildID(false);
readBuildID(); // yes I'm calling the function from itself. potential infinite loop? possibly. I haven't encountered it yet!
readBuildID(); // yes I'm calling the function from itself. potential infinite loop? possibly. I haven't encountered it yet!
return;
}
} catch (final Exception e) {
Out.err("Cant Read " + var.buildIDFile + "!");
Out.err(e.getLocalizedMessage());
Out.err("");
log.error("Cant Read " + var.buildIDFile + "!");
log.error(e.getLocalizedMessage());
log.error("");
// e.printStackTrace();
buildID(false);
readBuildID();
@ -398,13 +408,12 @@ public class Update {
/**
* Updates MLG to the Latest Version
*
*
* @author Morlok8k
*
*/
public static boolean updateMLG() {
buildID(true); //get latest BuildID file.
buildID(true); //get latest BuildID file.
var.MLG_Last_Modified_Date = null;
readBuildID();
@ -416,14 +425,14 @@ public class Update {
s = e.next();
diff = var.MLG_Last_Modified_Date.compareTo(new Date(new Long(s)));
if (diff < 0) { // if this is less than 0, there is a new version of MLG on the Internet!
Out.out("There is a NEW VERSION Of " + var.PROG_NAME + " available online!");
if (diff < 0) { // if this is less than 0, there is a new version of MLG on the Internet!
log.info("There is a NEW VERSION Of " + var.PROG_NAME + " available online!");
try {
final File fileRename = new File(var.MLG_JarFile);
fileRename.renameTo(new File(var.MLG_JarFile + ".old"));
} catch (final Exception e1) {
Out.out("Rename attempt #1 failed!");
log.info("Rename attempt #1 failed!");
e1.printStackTrace();
try {
@ -431,7 +440,7 @@ public class Update {
final File fileDelete = new File(var.MLG_JarFile);
fileDelete.delete();
} catch (final Exception e2) {
Out.out("Rename attempt #2 failed!");
log.info("Rename attempt #2 failed!");
e2.printStackTrace();
return false;
@ -441,7 +450,7 @@ public class Update {
final boolean fileSuccess = DownloadFile.downloadFile(var.github_MLG_jar_URL, true);
if (fileSuccess) {
Out.out(var.MLG_JarFile + " downloaded.");
log.info(var.MLG_JarFile + " downloaded.");
return true;
}
@ -453,14 +462,14 @@ public class Update {
/**
* <b>.zip file Get Modification Time</b><br>
*
* <p>
* Takes a string of a path to a .zip file (or .jar), and and returns a Long of the latest "Last Time Modified". <br>
* <br>
*
* <p>
* Thanks to the following:<br>
* <a href="http://www.java-examples.com/get-modification-time-zip-entry-example">http://www.java-examples.com/get-modification-time-zip-entry-example</a><br>
* <a href="http://www.java-examples.com/get-crc-32-checksum-zip-entry-example">http://www.java-examples.com/get-crc-32-checksum-zip-entry-example</a>
*
*
* @param zipFile
* @return
* @author Morlok8k
@ -480,7 +489,7 @@ public class Update {
final Enumeration<? extends ZipEntry> e = zipF.entries();
if (var.testing) {
Out.outD("File Name\t\tCRC\t\tModification Time\n---------------------------------\n");
log.info("File Name\t\tCRC\t\tModification Time\n---------------------------------\n");
}
while (e.hasMoreElements()) {
@ -488,7 +497,7 @@ public class Update {
Long modTime = entry.getTime();
if (!(entry.getName().toUpperCase().contains(".CLASS"))) { //ignore highest timestamp for non .class files, as they can be injected into the .jar file much later after compiling.
if (!(entry.getName().toUpperCase().contains(".CLASS"))) { //ignore highest timestamp for non .class files, as they can be injected into the .jar file much later after compiling.
modTime = 0L;
}
@ -502,7 +511,7 @@ public class Update {
final Date modificationTime = new Date(modTime);
final String CRC = Long.toHexString(entry.getCrc());
Out.outD(entryName + "\t" + CRC + "\t" + modificationTime + "\t"
log.info(entryName + "\t" + CRC + "\t" + modificationTime + "\t"
+ modTime.toString());
}
@ -513,8 +522,8 @@ public class Update {
return highestModTime;
} catch (final IOException ioe) {
Out.out("Error opening zip file" + ioe);
return 0L; //return Jan. 1, 1970 12:00 GMT for failures
log.info("Error opening zip file" + ioe);
return 0L; //return Jan. 1, 1970 12:00 GMT for failures
}
}
}