imp plugin: handle npc changes to imps
The imps in puro-puro will change into imps after spawning as a null npc. Previously this would not track imps unless you happened to walk into visibility of one while it was an imp.
This commit is contained in:
@@ -34,6 +34,7 @@ import lombok.Getter;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.NpcChanged;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
@@ -97,6 +98,18 @@ public class ImplingsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcChanged(NpcChanged npcCompositionChanged)
|
||||
{
|
||||
NPC npc = npcCompositionChanged.getNpc();
|
||||
Impling impling = Impling.findImpling(npc.getId());
|
||||
|
||||
if (impling != null && !implings.contains(npc))
|
||||
{
|
||||
implings.add(npc);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user