aboutsummaryrefslogtreecommitdiff
path: root/src/net/brysonsteck/Resurrection/Resurrection.java
blob: 00c5568c79c53100906375dcb201040cad627e5a (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package net.brysonsteck.Resurrection;

import net.brysonsteck.Resurrection.commands.CommandAbout;
import net.brysonsteck.Resurrection.commands.CommandResurrect;
import net.brysonsteck.Resurrection.startup.CheckForUpdate;
import org.bukkit.command.CommandExecutor;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;

public class Resurrection extends JavaPlugin {
//    public Plugin plugin = getPlugin(Resurrection.class);

    //spigot things
    @Override
    public void onDisable() {
        super.onDisable();
    }

    @Override
    public void onEnable() {
        super.onEnable();
        PluginDescriptionFile pluginInfo = getDescription();

        // check for updates
        System.out.println("[Resurrection] Checking for updates...");
        CheckForUpdate check = new CheckForUpdate();
        String newestVersion = check.getVersion();
        String newestVersionURL = check.getVersionURL();
        if (pluginInfo.getVersion().equals(newestVersion)) {
            System.out.println("[Resurrection] " + newestVersion + " is the latest version of Resurrection.");
        } else {
            System.out.println("[Resurrection] A new version of Resurrection is available! (current: " + pluginInfo.getVersion() + ", newest: " + newestVersion);
            System.out.println("[Resurrection] You can download the latest release on GitHub here \\/");
            System.out.println("[Resurrection] " + newestVersionURL);
        }

        // register listener
        this.getServer().getPluginManager().registerEvents(new PlayerListener(), this);

        // register commands
        this.getCommand("about").setExecutor(new CommandAbout());
        this.getCommand("resurrect").setExecutor(new CommandResurrect());

        System.out.println("[Resurrection] Successfully Started.");
    }

    // end of spigot things
    public static void main(String[] args) {

//        PlayerData playerData = new PlayerData();
//        playerData.saveData("This is the first line\nthis is the second line");
//        System.out.println(playerData.getPlayers());
//        playerData.readData();

//        playerData.saveData("username,false,0");
//        System.out.println("now adding two more lines");
//        playerData.saveData(playerData.getPlayers() + "this is the third line\nthis is the fourth line\nthe thread is now sleeping\nonce more\nand again");
//        System.out.println(playerData.getPlayers());
//        try {
//            Thread.sleep(100000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }

    }

}