From 37e2e9d8e7726f91599da74e05ccb7d4d0ce0bc8 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 9 May 2020 15:48:12 +0200 Subject: [PATCH] fix: check if FakePlayer is in Array before removing --- .../src/main/java/de/cliffbreak/varo/managers/NPCManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/varo/src/main/java/de/cliffbreak/varo/managers/NPCManager.java b/varo/src/main/java/de/cliffbreak/varo/managers/NPCManager.java index a79b39e..cecc3b9 100644 --- a/varo/src/main/java/de/cliffbreak/varo/managers/NPCManager.java +++ b/varo/src/main/java/de/cliffbreak/varo/managers/NPCManager.java @@ -230,7 +230,9 @@ public class NPCManager { connection.sendPacket(new PacketPlayOutEntityDestroy(npc.getId())); } this.npcs.remove(npc); - this.isDying.remove(npc.getId()); + if (this.isDying.contains(npc.getId())) { + this.isDying.remove(npc.getId()); + } } } }