mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-23 18:45:34 +01:00
Merge branch 'Exortions/SongodaCore:master' into development (#27)
This commit is contained in:
commit
af9def96b3
@ -71,13 +71,7 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
||||
try {
|
||||
onPluginLoad();
|
||||
} catch (Throwable t) {
|
||||
Bukkit.getLogger().log(Level.SEVERE,
|
||||
"Unexpected error while loading " + getDescription().getName()
|
||||
+ " v" + getDescription().getVersion()
|
||||
+ " c" + SongodaCore.getCoreLibraryVersion()
|
||||
+ ": Disabling plugin!", t);
|
||||
|
||||
emergencyStop = true;
|
||||
crash(t);
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,13 +107,8 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
||||
|
||||
// Start Metrics
|
||||
Metrics.start(this);
|
||||
} catch (Throwable th) {
|
||||
Bukkit.getLogger().log(Level.SEVERE,
|
||||
"Unexpected error while loading " + getDescription().getName()
|
||||
+ " v" + getDescription().getVersion()
|
||||
+ " c" + SongodaCore.getCoreLibraryVersion()
|
||||
+ ": Disabling plugin!", th);
|
||||
|
||||
} catch (Throwable t) {
|
||||
crash(t);
|
||||
emergencyStop();
|
||||
|
||||
console.sendMessage(ChatColor.RED + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
|
||||
@ -224,4 +213,15 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Invoke this method if a severe error occurs and the plugin needs to shut down.
|
||||
|
||||
@param t Any exceptions that are thrown when crashed should be put here, and will print once the error message logs.
|
||||
*/
|
||||
public void crash(Throwable... t) {
|
||||
Bukkit.getLogger().log(Level.SEVERE, String.format("Unexpected error while loading %s v%s c%s: Disabling plugin!", getDescription().getName(), getDescription().getVersion(), SongodaCore.getCoreLibraryVersion()), t);
|
||||
emergencyStop();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user