Search in sources :

Example 1 with ExperienceChanged

use of net.runelite.api.events.ExperienceChanged in project runelite by runelite.

the class RSClientMixin method experiencedChanged.

@FieldHook("skillExperiences")
@Inject
public static void experiencedChanged(int idx) {
    ExperienceChanged experienceChanged = new ExperienceChanged();
    Skill[] possibleSkills = Skill.values();
    // We subtract one here because 'Overall' isn't considered a skill that's updated.
    if (idx < possibleSkills.length - 1) {
        Skill updatedSkill = possibleSkills[idx];
        experienceChanged.setSkill(updatedSkill);
        eventBus.post(experienceChanged);
    }
}
Also used : ExperienceChanged(net.runelite.api.events.ExperienceChanged) Skill(net.runelite.api.Skill) Inject(net.runelite.api.mixins.Inject) FieldHook(net.runelite.api.mixins.FieldHook)

Aggregations

Skill (net.runelite.api.Skill)1 ExperienceChanged (net.runelite.api.events.ExperienceChanged)1 FieldHook (net.runelite.api.mixins.FieldHook)1 Inject (net.runelite.api.mixins.Inject)1