resurrection/src/net/brysonsteck/Resurrection/Resurrection.java

68 lines
2.6 KiB
Java
Raw Normal View History

2021-06-06 11:49:01 -06:00
package net.brysonsteck.Resurrection;
2021-06-05 23:10:04 -06:00
2021-06-06 11:49:01 -06:00
import net.brysonsteck.Resurrection.commands.CommandAbout;
2021-06-06 12:18:29 -06:00
import net.brysonsteck.Resurrection.commands.CommandResurrect;
2021-06-06 17:17:52 -06:00
import net.brysonsteck.Resurrection.startup.CheckForUpdate;
2021-06-06 12:18:29 -06:00
import org.bukkit.command.CommandExecutor;
2021-06-05 23:10:04 -06:00
import org.bukkit.plugin.Plugin;
2021-06-06 17:17:52 -06:00
import org.bukkit.plugin.PluginDescriptionFile;
2021-06-05 23:10:04 -06:00
import org.bukkit.plugin.java.JavaPlugin;
public class Resurrection extends JavaPlugin {
2021-06-06 18:34:30 -06:00
public Plugin plugin = getPlugin(Resurrection.class);
2021-06-05 23:10:04 -06:00
//spigot things
@Override
public void onDisable() {
super.onDisable();
}
@Override
public void onEnable() {
super.onEnable();
2021-06-06 17:17:52 -06:00
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);
}
2021-06-06 11:49:01 -06:00
// register listener
2021-06-06 11:06:51 -06:00
this.getServer().getPluginManager().registerEvents(new PlayerListener(), this);
2021-06-06 11:49:01 -06:00
// register commands
this.getCommand("about").setExecutor(new CommandAbout());
2021-06-06 12:18:29 -06:00
this.getCommand("resurrect").setExecutor(new CommandResurrect());
2021-06-06 11:49:01 -06:00
2021-06-06 17:17:52 -06:00
System.out.println("[Resurrection] Successfully Started.");
2021-06-05 23:10:04 -06:00
}
// 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();
// }
}
}