Fix
This commit is contained in:
@@ -36,6 +36,7 @@ import lombok.AccessLevel;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
|
import net.runelite.api.events.GameTick;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
import net.runelite.api.events.NpcDespawned;
|
import net.runelite.api.events.NpcDespawned;
|
||||||
import net.runelite.api.events.NpcSpawned;
|
import net.runelite.api.events.NpcSpawned;
|
||||||
@@ -111,14 +112,12 @@ public class ImplingsPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onNpcSpawned(NpcSpawned npcSpawned)
|
public void onGameTick(GameTick event)
|
||||||
{
|
{
|
||||||
NPC npc = npcSpawned.getNpc();
|
implingCounterMap.clear();
|
||||||
Impling impling = Impling.findImpling(npc.getId());
|
for (NPC npc : implings)
|
||||||
|
|
||||||
if (impling != null)
|
|
||||||
{
|
{
|
||||||
implings.add(npc);
|
Impling impling = Impling.findImpling(npc.getId());
|
||||||
|
|
||||||
ImplingType type = impling.getImplingType();
|
ImplingType type = impling.getImplingType();
|
||||||
if (implingCounterMap.containsKey(type))
|
if (implingCounterMap.containsKey(type))
|
||||||
@@ -132,6 +131,18 @@ public class ImplingsPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onNpcSpawned(NpcSpawned npcSpawned)
|
||||||
|
{
|
||||||
|
NPC npc = npcSpawned.getNpc();
|
||||||
|
Impling impling = Impling.findImpling(npc.getId());
|
||||||
|
|
||||||
|
if (impling != null)
|
||||||
|
{
|
||||||
|
implings.add(npc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameStateChanged(GameStateChanged event)
|
public void onGameStateChanged(GameStateChanged event)
|
||||||
{
|
{
|
||||||
@@ -153,8 +164,6 @@ public class ImplingsPlugin extends Plugin
|
|||||||
NPC npc = npcDespawned.getNpc();
|
NPC npc = npcDespawned.getNpc();
|
||||||
implings.remove(npc);
|
implings.remove(npc);
|
||||||
|
|
||||||
Impling impling = Impling.findImpling(npc.getId());
|
|
||||||
if (impling != null) implingCounterMap.put(impling.getImplingType(), implingCounterMap.get(impling.getImplingType()) - 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean showNpc(NPC npc)
|
boolean showNpc(NPC npc)
|
||||||
|
|||||||
Reference in New Issue
Block a user