mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Synchronize child access
This commit is contained in:
parent
1c59186b61
commit
9750e1fe8b
@ -68,8 +68,8 @@ class EventNodeImpl<T extends Event> implements EventNode<T> {
|
||||
|
||||
@Override
|
||||
public <E extends T> @NotNull List<EventNode<E>> findChildren(@NotNull String name, Class<E> eventType) {
|
||||
if (children.isEmpty()) return Collections.emptyList();
|
||||
synchronized (GLOBAL_CHILD_LOCK) {
|
||||
if (children.isEmpty()) return Collections.emptyList();
|
||||
List<EventNode<E>> result = new ArrayList<>();
|
||||
for (EventNode<T> child : children) {
|
||||
if (equals(child, name, eventType)) {
|
||||
|
Loading…
Reference in New Issue
Block a user