use of org.bukkit.event.Listener in project Essentials by drtshock.
the class Essentials method handleCrash.
private void handleCrash(Throwable exception) {
final PluginManager pm = getServer().getPluginManager();
LOGGER.log(Level.SEVERE, exception.toString());
exception.printStackTrace();
pm.registerEvents(new Listener() {
@EventHandler(priority = EventPriority.LOW)
public void onPlayerJoin(final PlayerJoinEvent event) {
event.getPlayer().sendMessage("Essentials failed to load, read the log file.");
}
}, this);
for (Player player : getOnlinePlayers()) {
player.sendMessage("Essentials failed to load, read the log file.");
}
this.setEnabled(false);
}
Aggregations