diff options
| author | davidovski <david@davidovski.xyz> | 2025-10-11 04:55:51 +0100 |
|---|---|---|
| committer | davidovski <david@davidovski.xyz> | 2025-10-11 04:55:51 +0100 |
| commit | 10b327e9f6441a8863227ce3e075a5a587654065 (patch) | |
| tree | 5e94ecc91290febacf5181d3596563a7a24bd010 /src/main/java/net/uomc/mineshaft/RunMineshaft.java | |
v0.3.1
Diffstat (limited to 'src/main/java/net/uomc/mineshaft/RunMineshaft.java')
| -rw-r--r-- | src/main/java/net/uomc/mineshaft/RunMineshaft.java | 46 |
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(); + } + } +} |
