Add /paper dumplisteners command
This commit is contained in:
@@ -70,9 +70,18 @@ public interface EventExecutor {
|
||||
try {
|
||||
EventExecutor asmExecutor = executorClass.newInstance();
|
||||
// Define a wrapper to conform to bukkit stupidity (passing in events that don't match and wrapper exception)
|
||||
return (listener, event) -> {
|
||||
if (!eventClass.isInstance(event)) return;
|
||||
asmExecutor.execute(listener, event);
|
||||
return new EventExecutor() {
|
||||
@Override
|
||||
public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException {
|
||||
if (!eventClass.isInstance(event)) return;
|
||||
asmExecutor.execute(listener, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String toString() {
|
||||
return "ASMEventExecutor['" + m + "']";
|
||||
}
|
||||
};
|
||||
} catch (InstantiationException | IllegalAccessException e) {
|
||||
throw new AssertionError("Unable to initialize generated event executor", e);
|
||||
|
||||
@@ -78,4 +78,27 @@ public class RegisteredListener {
|
||||
public boolean isIgnoringCancelled() {
|
||||
return ignoreCancelled;
|
||||
}
|
||||
|
||||
// Paper start
|
||||
/**
|
||||
* Get the executor for this registration.
|
||||
*
|
||||
* @return executor
|
||||
*/
|
||||
@NotNull
|
||||
public EventExecutor getExecutor() {
|
||||
return this.executor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RegisteredListener{"
|
||||
+ "plugin=\"" + this.plugin.getName()
|
||||
+ "\", listener=\"" + this.listener
|
||||
+ "\", executor=\"" + this.executor
|
||||
+ "\", priority=\"" + this.priority.name() + " (" + this.priority.getSlot() + ")"
|
||||
+ "\", ignoringCancelled=" + this.ignoreCancelled
|
||||
+ "}";
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user