diff --git a/src/net/brysonsteck/Resurrection/Resurrection.java b/src/net/brysonsteck/Resurrection/Resurrection.java index 6a6492f..b3d9b99 100644 --- a/src/net/brysonsteck/Resurrection/Resurrection.java +++ b/src/net/brysonsteck/Resurrection/Resurrection.java @@ -48,6 +48,25 @@ public class Resurrection extends JavaPlugin implements Listener { } + // check for updates + System.out.println("[Resurrection] Checking for updates..."); + CheckForUpdate check = new CheckForUpdate(); + boolean outdated = false; + if (check.isSuccess()) { + 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); + outdated = true; + } + } + + System.out.println("[Resurrection] ---------------------------------------------------------"); + System.out.println("[Resurrection] Locating the file \"playerData.resurrection\"..."); // check if playerData.resurrection exists File playerFile = new File("plugins/playerData.resurrection"); @@ -59,6 +78,8 @@ public class Resurrection extends JavaPlugin implements Listener { } catch (IOException e) { System.out.println("[Resurrection] An error has occurred creating the player data file!"); e.printStackTrace(); + System.out.println("[Resurrection] This file is crucial to Resurrection. Since the file could not be created, the plugin will now stop."); + System.exit(1); } } else { System.out.println("[Resurrection] The player data file has been found!"); @@ -66,25 +87,6 @@ public class Resurrection extends JavaPlugin implements Listener { System.out.println("[Resurrection] ---------------------------------------------------------"); - // check for updates - System.out.println("[Resurrection] Checking for updates..."); - CheckForUpdate check = new CheckForUpdate(); - boolean outdated = false; - if (check.isSuccess()) { - 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); - outdated = true; - } - } - - System.out.println("[Resurrection] ---------------------------------------------------------"); - System.out.println("[Resurrection] Registering listeners and adding commands..."); // register listener this.getServer().getPluginManager().registerEvents(new PlayerListener(), this); diff --git a/src/net/brysonsteck/Resurrection/commands/CommandHowLong.java b/src/net/brysonsteck/Resurrection/commands/CommandHowLong.java index ecb955b..d4c2360 100644 --- a/src/net/brysonsteck/Resurrection/commands/CommandHowLong.java +++ b/src/net/brysonsteck/Resurrection/commands/CommandHowLong.java @@ -53,6 +53,12 @@ public class CommandHowLong implements CommandExecutor { commandSender.sendMessage(p.getDisplayName() + " will respawn in " + timeCheck.formatTime()); } return true; + } else { + if (self) { + commandSender.sendMessage("You aren't dead, dummy."); + } else { + commandSender.sendMessage("ERROR: " + p.getDisplayName() + " is not dead!"); + } } } }