use of fr.xephi.authme.listener.PlayerListener16 in project AuthMeReloaded by AuthMe.
the class AuthMe method registerEventListeners.
/**
* Registers all event listeners.
*
* @param injector the injector
*/
void registerEventListeners(Injector injector) {
// Get the plugin manager instance
PluginManager pluginManager = getServer().getPluginManager();
// Register event listeners
pluginManager.registerEvents(injector.getSingleton(PlayerListener.class), this);
pluginManager.registerEvents(injector.getSingleton(BlockListener.class), this);
pluginManager.registerEvents(injector.getSingleton(EntityListener.class), this);
pluginManager.registerEvents(injector.getSingleton(ServerListener.class), this);
// Try to register 1.6 player listeners
if (isClassLoaded("org.bukkit.event.player.PlayerEditBookEvent")) {
pluginManager.registerEvents(injector.getSingleton(PlayerListener16.class), this);
}
// Try to register 1.8 player listeners
if (isClassLoaded("org.bukkit.event.player.PlayerInteractAtEntityEvent")) {
pluginManager.registerEvents(injector.getSingleton(PlayerListener18.class), this);
}
// Try to register 1.9 player listeners
if (isClassLoaded("org.bukkit.event.player.PlayerSwapHandItemsEvent")) {
pluginManager.registerEvents(injector.getSingleton(PlayerListener19.class), this);
}
// Register listener for 1.11 events if available
if (isClassLoaded("org.bukkit.event.entity.EntityAirChangeEvent")) {
pluginManager.registerEvents(injector.getSingleton(PlayerListener111.class), this);
}
}
Aggregations