fix: check if FakePlayer is in Array before removing

This commit is contained in:
Simon Giesel 2020-05-09 15:48:12 +02:00
parent 6716988c45
commit 37e2e9d8e7

View file

@ -230,10 +230,12 @@ public class NPCManager {
connection.sendPacket(new PacketPlayOutEntityDestroy(npc.getId())); connection.sendPacket(new PacketPlayOutEntityDestroy(npc.getId()));
} }
this.npcs.remove(npc); this.npcs.remove(npc);
if (this.isDying.contains(npc.getId())) {
this.isDying.remove(npc.getId()); this.isDying.remove(npc.getId());
} }
} }
} }
}
public void removeClone(final UUID uuid) { public void removeClone(final UUID uuid) {
for (int i = 0; i < this.npcs.size(); i++) { for (int i = 0; i < this.npcs.size(); i++) {