summaryrefslogtreecommitdiff
path: root/src/main/java/net/uomc/mineshaft/RunMineshaft.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/uomc/mineshaft/RunMineshaft.java')
-rw-r--r--src/main/java/net/uomc/mineshaft/RunMineshaft.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/main/java/net/uomc/mineshaft/RunMineshaft.java b/src/main/java/net/uomc/mineshaft/RunMineshaft.java
new file mode 100644
index 0000000..9115561
--- /dev/null
+++ b/src/main/java/net/uomc/mineshaft/RunMineshaft.java
@@ -0,0 +1,46 @@
+package net.uomc.mineshaft;
+
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.time.LocalDateTime;
+
+import org.json.JSONObject;
+import org.json.JSONTokener;
+
+public class RunMineshaft {
+ private static JSONObject config;
+
+ public static void main(String[] args) throws InterruptedException {
+ LocalDateTime time = LocalDateTime.now();
+ System.out.println("");
+ System.out.println("===================================== " + time.getDayOfMonth() + "/" + time.getMonthValue() + "/" + time.getYear() + " " + time.getHour() + ":" + time.getMinute() + ":" + time.getSecond() + " =====================================");
+ config = new JSONObject();
+ load();
+
+ try {
+ new Mineshaft(config);
+
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ System.exit(0);
+
+ }
+
+ }
+
+ public static void load() {
+
+ try {
+ JSONTokener parser = new JSONTokener(new FileReader("config.json"));
+ JSONObject obj = (JSONObject) parser.nextValue();
+ config = obj;
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (NullPointerException e) {
+ e.printStackTrace();
+ }
+ }
+}