mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
Fix recursive class selection
This commit is contained in:
parent
9a4ced9a6e
commit
8297089ca8
@ -262,10 +262,9 @@ class EventNodeImpl<T extends Event> implements EventNode<T> {
|
|||||||
consumer.accept(type);
|
consumer.accept(type);
|
||||||
// Recursion
|
// Recursion
|
||||||
if (RecursiveEvent.class.isAssignableFrom(type)) {
|
if (RecursiveEvent.class.isAssignableFrom(type)) {
|
||||||
final var superclass = type.getSuperclass();
|
final Class<?> superclass = type.getSuperclass();
|
||||||
if (superclass != null && RecursiveEvent.class.isAssignableFrom(superclass)) consumer.accept(superclass);
|
if (superclass != null && RecursiveEvent.class.isAssignableFrom(superclass)) {
|
||||||
for (var inter : type.getInterfaces()) {
|
forTargetEvents(superclass, consumer);
|
||||||
if (RecursiveEvent.class.isAssignableFrom(inter)) consumer.accept(inter);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user