mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-08 01:17:47 +01:00
Add EventNode#removeChild
This commit is contained in:
parent
11bdcdf92a
commit
aa5a182788
@ -33,6 +33,8 @@ public interface EventNode<T extends Event> {
|
|||||||
|
|
||||||
void addChild(@NotNull EventNode<? extends T> child);
|
void addChild(@NotNull EventNode<? extends T> child);
|
||||||
|
|
||||||
|
void removeChild(@NotNull EventNode<? extends T> child);
|
||||||
|
|
||||||
void addListener(@NotNull EventListener<? extends T> listener);
|
void addListener(@NotNull EventListener<? extends T> listener);
|
||||||
|
|
||||||
void removeListener(@NotNull EventListener<? extends T> listener);
|
void removeListener(@NotNull EventListener<? extends T> listener);
|
||||||
|
@ -52,6 +52,11 @@ class EventNodeImpl<T extends Event> implements EventNode<T> {
|
|||||||
this.children.add((EventNode<T>) child);
|
this.children.add((EventNode<T>) child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeChild(@NotNull EventNode<? extends T> child) {
|
||||||
|
this.children.remove(child);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addListener(@NotNull EventListener<? extends T> listener) {
|
public void addListener(@NotNull EventListener<? extends T> listener) {
|
||||||
this.listenerMap.computeIfAbsent(listener.type, aClass -> new CopyOnWriteArrayList<>())
|
this.listenerMap.computeIfAbsent(listener.type, aClass -> new CopyOnWriteArrayList<>())
|
||||||
|
Loading…
Reference in New Issue
Block a user