diff --git a/src/main/java/net/minestom/server/event/EventNode.java b/src/main/java/net/minestom/server/event/EventNode.java index 615879052..21ce0f70e 100644 --- a/src/main/java/net/minestom/server/event/EventNode.java +++ b/src/main/java/net/minestom/server/event/EventNode.java @@ -33,6 +33,8 @@ public interface EventNode { void addChild(@NotNull EventNode child); + void removeChild(@NotNull EventNode child); + void addListener(@NotNull EventListener listener); void removeListener(@NotNull EventListener listener); diff --git a/src/main/java/net/minestom/server/event/EventNodeImpl.java b/src/main/java/net/minestom/server/event/EventNodeImpl.java index 0c9b5dc16..cc23dd219 100644 --- a/src/main/java/net/minestom/server/event/EventNodeImpl.java +++ b/src/main/java/net/minestom/server/event/EventNodeImpl.java @@ -52,6 +52,11 @@ class EventNodeImpl implements EventNode { this.children.add((EventNode) child); } + @Override + public void removeChild(@NotNull EventNode child) { + this.children.remove(child); + } + @Override public void addListener(@NotNull EventListener listener) { this.listenerMap.computeIfAbsent(listener.type, aClass -> new CopyOnWriteArrayList<>())