JitseB / NPCLib

(Minecraft) NPCLib – Basic non-player character library.
MIT License
197 stars 49 forks source link

possible bug #158

Open Endrjuu opened 3 years ago

Endrjuu commented 3 years ago

Describe the bug NPC is already shown to player, ConcurrentModificationException, NoSuchElementException packet_handler

NPCLib usage option api

Server version 1.8.8

To Reproduce join event, refresh

Steps to reproduce the behavior:

  1. https://pastebin.com/N2JPBUhY
  2. https://pastebin.com/1fsFHDaB
  3. https://pastebin.com/A9KqjFnc

My code: https://pastebin.com/N5Fzkny3 https://pastebin.com/U8ffuRce https://pastebin.com/dJZAiHaW

Mooselk commented 3 years ago
  1. I wouldn’t create npcs asynchronously. It causes a lot of issues, one being npcs not showing.
    1. You’re showing them twice, once when you create them and again when you’re joining (it at least that’s what it looks like)
    2. You don’t need a list for your npcs, the library already saves them in a set for you. There’s a static getter in the NPCManager class for this.