Search in sources :

Example 1 with EventManager

use of com.velocitypowered.api.event.EventManager in project LibertyBans by A248.

the class VelocityParallelisedListener method unregister.

@Override
public void unregister() {
    EventManager eventManager = server.getEventManager();
    eventManager.unregister(plugin, handler);
}
Also used : EventManager(com.velocitypowered.api.event.EventManager)

Example 2 with EventManager

use of com.velocitypowered.api.event.EventManager in project LibertyBans by A248.

the class VelocityParallelisedListener method register.

@Override
public final void register() {
    Class<E> eventClass = getEventClass();
    EventManager eventManager = server.getEventManager();
    eventManager.register(plugin, eventClass, PostOrder.EARLY, handler);
}
Also used : EventManager(com.velocitypowered.api.event.EventManager)

Example 3 with EventManager

use of com.velocitypowered.api.event.EventManager in project LimboAPI by Elytrium.

the class EventManagerHook method init.

public static void init(LimboAPI plugin) throws IllegalAccessException, ExecutionException {
    instance = new EventManagerHook(plugin.getServer().getPluginManager(), plugin);
    EventManager oldEventManager = plugin.getServer().getEventManager();
    handlersMapField.set(instance, handlersMapField.get(oldEventManager));
    handlersCache.set(instance, handlersCache.get(oldEventManager));
    untargetedMethodHandlers.set(instance, untargetedMethodHandlers.get(oldEventManager));
    handlerAdapters.set(instance, handlerAdapters.get(oldEventManager));
    eventTypeTracker.set(instance, eventTypeTracker.get(oldEventManager));
    eventManager.set(plugin.getServer(), instance);
    eventManagerInCommandManager.set(plugin.getServer().getCommandManager(), instance);
}
Also used : VelocityEventManager(com.velocitypowered.proxy.event.VelocityEventManager) EventManager(com.velocitypowered.api.event.EventManager)

Example 4 with EventManager

use of com.velocitypowered.api.event.EventManager in project 2FA by LielAmar.

the class TwoFactorAuthentication method registerListeners.

public void registerListeners() {
    EventManager eventManager = this.proxy.getEventManager();
    eventManager.register(this, new OnPluginMessage(this));
    eventManager.register(this, new OnVelocityPlayerConnections(this));
    eventManager.register(this, new DisabledEvents(this));
    this.proxy.getChannelRegistrar().register(INCOMING = MinecraftChannelIdentifier.create(PluginMessagingHandler.channelName.split(":")[0], PluginMessagingHandler.channelName.split(":")[1]));
    this.proxy.getChannelRegistrar().register(OUTGOING = MinecraftChannelIdentifier.create(PluginMessagingHandler.channelName.split(":")[0], PluginMessagingHandler.channelName.split(":")[1]));
}
Also used : EventManager(com.velocitypowered.api.event.EventManager) OnVelocityPlayerConnections(com.lielamar.auth.velocity.listeners.OnVelocityPlayerConnections) OnPluginMessage(com.lielamar.auth.velocity.listeners.OnPluginMessage) DisabledEvents(com.lielamar.auth.velocity.listeners.DisabledEvents)

Example 5 with EventManager

use of com.velocitypowered.api.event.EventManager in project Parties by AlessioDP.

the class VelocityPartiesPlugin method registerListeners.

@Override
protected void registerListeners() {
    getLoggerManager().logDebug(Constants.DEBUG_PLUGIN_REGISTERING, true);
    ADPVelocityBootstrap plugin = (ADPVelocityBootstrap) getBootstrap();
    EventManager em = plugin.getServer().getEventManager();
    em.register(plugin, new VelocityChatListener(this));
    em.register(plugin, new VelocityFollowListener(this));
    em.register(plugin, new VelocityJoinLeaveListener(this));
}
Also used : VelocityFollowListener(com.alessiodp.parties.velocity.listeners.VelocityFollowListener) ADPVelocityBootstrap(com.alessiodp.core.velocity.bootstrap.ADPVelocityBootstrap) VelocityEventManager(com.alessiodp.parties.velocity.events.VelocityEventManager) EventManager(com.velocitypowered.api.event.EventManager) VelocityChatListener(com.alessiodp.parties.velocity.listeners.VelocityChatListener) VelocityJoinLeaveListener(com.alessiodp.parties.velocity.listeners.VelocityJoinLeaveListener)

Aggregations

EventManager (com.velocitypowered.api.event.EventManager)5 ADPVelocityBootstrap (com.alessiodp.core.velocity.bootstrap.ADPVelocityBootstrap)1 VelocityEventManager (com.alessiodp.parties.velocity.events.VelocityEventManager)1 VelocityChatListener (com.alessiodp.parties.velocity.listeners.VelocityChatListener)1 VelocityFollowListener (com.alessiodp.parties.velocity.listeners.VelocityFollowListener)1 VelocityJoinLeaveListener (com.alessiodp.parties.velocity.listeners.VelocityJoinLeaveListener)1 DisabledEvents (com.lielamar.auth.velocity.listeners.DisabledEvents)1 OnPluginMessage (com.lielamar.auth.velocity.listeners.OnPluginMessage)1 OnVelocityPlayerConnections (com.lielamar.auth.velocity.listeners.OnVelocityPlayerConnections)1 VelocityEventManager (com.velocitypowered.proxy.event.VelocityEventManager)1