13
0
geforkt von Mirrors/Velocity

Slightly optimize SimpleEventBus usage in VelocityEventManager

Dieser Commit ist enthalten in:
Luck 2018-12-03 23:53:50 +00:00
Ursprung 43da3d4541
Commit cfae542dd2
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EFA9B3EC5FD90F8B

Datei anzeigen

@ -47,7 +47,13 @@ public class VelocityEventManager implements EventManager {
public VelocityEventManager(PluginManager pluginManager) { public VelocityEventManager(PluginManager pluginManager) {
PluginClassLoader cl = new PluginClassLoader(new URL[0]); PluginClassLoader cl = new PluginClassLoader(new URL[0]);
cl.addToClassloaders(); cl.addToClassloaders();
this.bus = new SimpleEventBus<>(Object.class); this.bus = new SimpleEventBus<Object>(Object.class) {
@Override
protected boolean shouldPost(@NonNull Object event, @NonNull EventSubscriber<?> subscriber) {
// Velocity doesn't use Cancellable or generic events, so we can skip those checks.
return true;
}
};
this.methodAdapter = new SimpleMethodSubscriptionAdapter<>(bus, this.methodAdapter = new SimpleMethodSubscriptionAdapter<>(bus,
new ASMEventExecutorFactory<>(cl), new ASMEventExecutorFactory<>(cl),
new VelocityMethodScanner()); new VelocityMethodScanner());