From 8dadaa50897b7ae90e9ce0ddc388e2133302a893 Mon Sep 17 00:00:00 2001 From: Ceikry Date: Thu, 9 Feb 2023 06:55:01 +0000 Subject: [PATCH] Fixed a concurrent modification exception in event dispatch --- Server/src/main/core/game/node/entity/Entity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Server/src/main/core/game/node/entity/Entity.java b/Server/src/main/core/game/node/entity/Entity.java index 2bdc10d75..db9a0d417 100644 --- a/Server/src/main/core/game/node/entity/Entity.java +++ b/Server/src/main/core/game/node/entity/Entity.java @@ -162,7 +162,8 @@ public abstract class Entity extends Node { { if(this.hooks.containsKey(event.getClass())) { - this.hooks.get(event.getClass()).forEach((hook) -> { hook.process(this, event); }); + ArrayList processList = new ArrayList(this.hooks.get(event.getClass())); + processList.forEach((hook) -> { hook.process(this, event); }); } }