geforkt von Mirrors/Velocity
Slightly optimize SimpleEventBus usage in VelocityEventManager
Dieser Commit ist enthalten in:
Ursprung
43da3d4541
Commit
cfae542dd2
@ -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());
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren