juliarn / npc-lib

Asynchronous, high-performance Minecraft NPC library for 1.8-1.21 servers.
MIT License
296 stars 50 forks source link

plugin disable support #82

Closed erg43hergeg closed 1 year ago

erg43hergeg commented 1 year ago

my onDisable actually looks like this:

npcPool.npCs.forEach { npcPool.removeNPC(it.entityId) }

1.NPCs do not disappear

  1. PlayerNPCHideEvent is called and throws an error because the plugin is already disabled
neziw commented 1 year ago

and what's wrong with this? It's normal that event will throw exception if plugin is disabled lol

derklaro commented 1 year ago

This issue is fixed in v3 as we're using a custom event bus there which does not rely on the internal bukkit state handling. (From my perspective it's a weird handling to mark a plugin as disabled before it's disabled anyway). I will close this as the issue should is resolved in v3.