use of net.runelite.api.mixins.Inject in project runelite by runelite.
the class RSClientMixin method getNpcs.
@Inject
@Override
public List<NPC> getNpcs() {
int validNpcIndexes = getNpcIndexesCount();
int[] npcIndexes = getNpcIndices();
NPC[] cachedNpcs = getCachedNPCs();
List<NPC> npcs = new ArrayList<NPC>(validNpcIndexes);
for (int i = 0; i < validNpcIndexes; ++i) {
npcs.add(cachedNpcs[npcIndexes[i]]);
}
return npcs;
}
use of net.runelite.api.mixins.Inject in project runelite by runelite.
the class RSClientMixin method getWidget.
@Inject
@Override
public Widget getWidget(WidgetInfo widget) {
int groupId = widget.getGroupId();
int childId = widget.getChildId();
return getWidget(groupId, childId);
}
use of net.runelite.api.mixins.Inject in project runelite by runelite.
the class RSClientMixin method gameStateChanged.
@FieldHook("gameState")
@Inject
public static void gameStateChanged(int idx) {
GameStateChanged gameStateChange = new GameStateChanged();
gameStateChange.setGameState(client.getGameState());
eventBus.post(gameStateChange);
}
use of net.runelite.api.mixins.Inject in project runelite by runelite.
the class RSClientMixin method onGrandExchangeOffersChanged.
@Inject
@FieldHook("grandExchangeOffers")
public static void onGrandExchangeOffersChanged(int idx) {
if (idx == -1) {
return;
}
GrandExchangeOffer internalOffer = client.getGrandExchangeOffers()[idx];
if (internalOffer == null) {
return;
}
GrandExchangeOfferChanged offerChangedEvent = new GrandExchangeOfferChanged();
offerChangedEvent.setOffer(internalOffer);
offerChangedEvent.setSlot(idx);
eventBus.post(offerChangedEvent);
}
use of net.runelite.api.mixins.Inject in project runelite by runelite.
the class RSClientMixin method boostedSkillLevelsChanged.
@FieldHook("boostedSkillLevels")
@Inject
public static void boostedSkillLevelsChanged(int idx) {
Skill[] skills = Skill.values();
if (idx >= 0 && idx < skills.length - 1) {
Skill updatedSkill = skills[idx];
BoostedLevelChanged boostedLevelChanged = new BoostedLevelChanged();
boostedLevelChanged.setSkill(updatedSkill);
eventBus.post(boostedLevelChanged);
}
}
Aggregations