summaryrefslogtreecommitdiff
path: root/src/main/java/net/uomc/mineshaft/RunMineshaft.java
blob: 911556177b7fd5bca7578b9538bf37c04deac156 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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();
        }
    }
}