use of net.runelite.api.mixins.Inject in project runelite by runelite.
the class RSPlayerMixin method rotate.
@Inject
private List<Triangle> rotate(List<Triangle> triangles, int orientation) {
List<Triangle> rotatedTriangles = new ArrayList<Triangle>();
for (Triangle triangle : triangles) {
Vertex a = triangle.getA();
Vertex b = triangle.getB();
Vertex c = triangle.getC();
Triangle rotatedTriangle = new Triangle(a.rotate(orientation), b.rotate(orientation), c.rotate(orientation));
rotatedTriangles.add(rotatedTriangle);
}
return rotatedTriangles;
}
use of net.runelite.api.mixins.Inject in project runelite by runelite.
the class RSClientMixin method draggingWidgetChanged.
@FieldHook("draggingWidget")
@Inject
public static void draggingWidgetChanged(int idx) {
DraggingWidgetChanged draggingWidgetChanged = new DraggingWidgetChanged();
draggingWidgetChanged.setDraggingWidget(client.isDraggingWidget());
eventBus.post(draggingWidgetChanged);
}
use of net.runelite.api.mixins.Inject 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);
}
}
use of net.runelite.api.mixins.Inject in project runelite by runelite.
the class RSClientMixin method getProjectiles.
@Inject
@Override
public List<Projectile> getProjectiles() {
List<Projectile> projectiles = new ArrayList<Projectile>();
RSDeque projectileDeque = this.getProjectilesDeque();
Node head = projectileDeque.getHead();
for (Node node = head.getNext(); node != head; node = node.getNext()) {
projectiles.add((Projectile) node);
}
return projectiles;
}
use of net.runelite.api.mixins.Inject in project runelite by runelite.
the class RSClientMixin method getPlayers.
@Inject
@Override
public List<Player> getPlayers() {
int validPlayerIndexes = getPlayerIndexesCount();
int[] playerIndexes = getPlayerIndices();
Player[] cachedPlayers = getCachedPlayers();
List<Player> players = new ArrayList<Player>(validPlayerIndexes);
for (int i = 0; i < validPlayerIndexes; ++i) {
players.add(cachedPlayers[playerIndexes[i]]);
}
return players;
}
Aggregations