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

68 lines
3.2 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-15 18:43:25 -06:00
import net.brysonsteck.Resurrection.player.PlayerListener;
2021-06-06 17:17:52 -06:00
import net.brysonsteck.Resurrection.startup.CheckForUpdate;
2021-06-06 19:10:32 -06:00
import org.bukkit.event.Listener;
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;
2021-06-06 19:10:32 -06:00
public class Resurrection extends JavaPlugin implements Listener {
2021-06-05 23:10:04 -06:00
//spigot things
@Override
public void onDisable() {
super.onDisable();
2021-06-15 20:23:28 -06:00
System.out.println("[Resurrection] Resurrection has completed shutdown.");
2021-06-05 23:10:04 -06:00
}
@Override
public void onEnable() {
super.onEnable();
2021-06-15 20:15:51 -06:00
System.out.println("[Resurrection] Resurrection is starting!");
2021-06-06 17:17:52 -06:00
PluginDescriptionFile pluginInfo = getDescription();
2021-06-06 19:10:32 -06:00
getServer().getPluginManager().registerEvents(this, this);
2021-06-06 17:17:52 -06:00
2021-06-15 20:23:28 -06:00
if (pluginInfo.getVersion().contains("beta")) {
// beta message
System.out.println("[Resurrection] ---------------------------------------------------------");
System.out.println("[Resurrection] WARNING!!!!");
System.out.println("[Resurrection] You are running a beta version of Resurrection!");
System.out.println("[Resurrection] ");
System.out.println("[Resurrection] This means that this plugin is early in development and");
System.out.println("[Resurrection] not completely finished, and as a result you may");
System.out.println("[Resurrection] experience unexpected doodads. Make sure that the plugin");
System.out.println("[Resurrection] is up-to-date for more features and bug fixes. The plugin");
System.out.println("[Resurrection] will now check for updates.");
System.out.println("[Resurrection] ---------------------------------------------------------");
}
2021-06-15 20:15:51 -06:00
2021-06-06 17:17:52 -06:00
// 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
2021-06-15 20:15:51 -06:00
System.out.println("[Resurrection] Adding commands...");
2021-06-06 11:49:01 -06:00
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-15 20:15:51 -06:00
System.out.println("[Resurrection] Successfully Started!");
2021-06-05 23:10:04 -06:00
}
2021-06-15 20:15:51 -06:00
public static void main(String[] args) { }
2021-06-05 23:10:04 -06:00
}