Search in sources :

Example 1 with PlayerListener19

use of fr.xephi.authme.listener.PlayerListener19 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);
    }
}
Also used : PluginManager(org.bukkit.plugin.PluginManager) EntityListener(fr.xephi.authme.listener.EntityListener) PlayerListener111(fr.xephi.authme.listener.PlayerListener111) PlayerListener16(fr.xephi.authme.listener.PlayerListener16) PlayerListener19(fr.xephi.authme.listener.PlayerListener19) PlayerListener18(fr.xephi.authme.listener.PlayerListener18) BlockListener(fr.xephi.authme.listener.BlockListener) PlayerListener(fr.xephi.authme.listener.PlayerListener) ServerListener(fr.xephi.authme.listener.ServerListener)

Aggregations

BlockListener (fr.xephi.authme.listener.BlockListener)1 EntityListener (fr.xephi.authme.listener.EntityListener)1 PlayerListener (fr.xephi.authme.listener.PlayerListener)1 PlayerListener111 (fr.xephi.authme.listener.PlayerListener111)1 PlayerListener16 (fr.xephi.authme.listener.PlayerListener16)1 PlayerListener18 (fr.xephi.authme.listener.PlayerListener18)1 PlayerListener19 (fr.xephi.authme.listener.PlayerListener19)1 ServerListener (fr.xephi.authme.listener.ServerListener)1 PluginManager (org.bukkit.plugin.PluginManager)1