From 10b327e9f6441a8863227ce3e075a5a587654065 Mon Sep 17 00:00:00 2001 From: davidovski Date: Sat, 11 Oct 2025 04:55:51 +0100 Subject: v0.3.1 --- src/main/java/net/uomc/mineshaft/RunMineshaft.java | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/main/java/net/uomc/mineshaft/RunMineshaft.java (limited to 'src/main/java/net/uomc/mineshaft/RunMineshaft.java') 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(); + } + } +} -- cgit v1.2.3