mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +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
|
@Override
|
||||||
public <E extends T> @NotNull List<EventNode<E>> findChildren(@NotNull String name, Class<E> eventType) {
|
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) {
|
synchronized (GLOBAL_CHILD_LOCK) {
|
||||||
|
if (children.isEmpty()) return Collections.emptyList();
|
||||||
List<EventNode<E>> result = new ArrayList<>();
|
List<EventNode<E>> result = new ArrayList<>();
|
||||||
for (EventNode<T> child : children) {
|
for (EventNode<T> child : children) {
|
||||||
if (equals(child, name, eventType)) {
|
if (equals(child, name, eventType)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user