check the class is exist

This commit is contained in:
DNx5 2015-10-06 04:07:49 +07:00
parent d7dfa3e4ac
commit 157b028712

View File

@ -259,9 +259,11 @@ public class AuthMe extends JavaPlugin {
// Register events // Register events
pm.registerEvents(new AuthMePlayerListener(this), this); pm.registerEvents(new AuthMePlayerListener(this), this);
// Try to register 1.8 player listeners // Try to register 1.8 player listeners
ConsoleLogger.info("Trying to register bukkit 1.8 listeners, if an error is shown below please don't report it!"); try {
ConsoleLogger.info("It only means that you're using a previous version of the server."); Class.forName("org.bukkit.event.player.PlayerInteractAtEntityEvent");
pm.registerEvents(new AuthMePlayerListener18(this), this); pm.registerEvents(new AuthMePlayerListener18(this), this);
} catch (ClassNotFoundException ignore) {
}
pm.registerEvents(new AuthMeBlockListener(this), this); pm.registerEvents(new AuthMeBlockListener(this), this);
pm.registerEvents(new AuthMeEntityListener(this), this); pm.registerEvents(new AuthMeEntityListener(this), this);
pm.registerEvents(new AuthMeServerListener(this), this); pm.registerEvents(new AuthMeServerListener(this), this);