diff --git a/main/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java b/main/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java index 4910e79fa..31aa63270 100644 --- a/main/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java +++ b/main/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java @@ -1,6 +1,8 @@ package net.citizensnpcs.npc.ai; +import java.util.ArrayList; import java.util.Iterator; +import java.util.List; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -289,10 +291,14 @@ public class CitizensNavigator implements Navigator, Runnable { if (!isNavigating()) return; Iterator itr = localParams.callbacks().iterator(); + List callbacks = new ArrayList(); while (itr.hasNext()) { - itr.next().onCompletion(reason); + callbacks.add(itr.next()); itr.remove(); } + for (NavigatorCallback callback : callbacks) { + callback.onCompletion(reason); + } if (reason == null) { stopNavigating(); return;