Search in sources :

Example 1 with RSNPC

use of net.runelite.rs.api.RSNPC in project runelite by runelite.

the class RSClientMixin method cachedNPCsChanged.

@FieldHook("cachedNPCs")
@Inject
public static void cachedNPCsChanged(int idx) {
    RSNPC[] cachedNPCs = client.getCachedNPCs();
    if (idx < 0 || idx >= cachedNPCs.length) {
        return;
    }
    RSNPC npc = cachedNPCs[idx];
    if (npc != null) {
        npc.setIndex(idx);
    }
}
Also used : RSNPC(net.runelite.rs.api.RSNPC) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Aggregations

FieldHook (net.runelite.api.mixins.FieldHook)1 Inject (net.runelite.api.mixins.Inject)1 RSNPC (net.runelite.rs.api.RSNPC)1