use of net.runelite.api.NPC in project runelite by runelite.
the class BarrowsOverlay method render.
@Override
public Dimension render(Graphics2D graphics) {
Player local = client.getLocalPlayer();
// tunnels are only on z=0
if (!plugin.getWalls().isEmpty() && client.getPlane() == 0 && config.showMinimap()) {
// NPC yellow dot
List<NPC> npcs = client.getNpcs();
for (NPC npc : npcs) {
net.runelite.api.Point minimapLocation = npc.getMinimapLocation();
if (minimapLocation != null) {
graphics.setColor(Color.yellow);
graphics.fillOval(minimapLocation.getX(), minimapLocation.getY(), 4, 4);
}
}
// Render barrows walls/doors
renderObjects(graphics, local);
// Player white dot
graphics.setColor(Color.white);
graphics.fillRect(local.getMinimapLocation().getX(), local.getMinimapLocation().getY(), 3, 3);
} else if (config.showBrotherLoc()) {
renderBarrowsBrothers(graphics);
}
return null;
}
use of net.runelite.api.NPC in project runelite by runelite.
the class MenuManager method removeNpcMenuOption.
public void removeNpcMenuOption(String option) {
npcMenuOptions.remove(option);
// remove this option from all npc compositions
Client client = clientProvider.get();
if (client == null) {
return;
}
for (NPC npc : client.getNpcs()) {
NPCComposition composition = npc.getComposition();
removeNpcOption(composition, option);
}
}
use of net.runelite.api.NPC in project runelite by runelite.
the class MenuManager method addNpcMenuOption.
public void addNpcMenuOption(String option) {
npcMenuOptions.add(option);
// add to surrounding npcs
Client client = clientProvider.get();
if (client == null) {
return;
}
for (NPC npc : client.getNpcs()) {
NPCComposition composition = npc.getComposition();
addNpcOption(composition, option);
}
}
use of net.runelite.api.NPC in project runelite by runelite.
the class ImplingsOverlay method render.
@Override
public Dimension render(Graphics2D graphics) {
NPC[] imps = plugin.getImplings();
if (imps == null) {
return null;
}
for (NPC imp : imps) {
if (imp == null || imp.getName() == null) {
continue;
}
// Spawns have the name "null", so they get changed to "Spawn"
String text = imp.getName().equals("null") ? "Spawn" : imp.getName();
drawImp(graphics, imp, text, plugin.getIds().get(imp.getId()));
}
return null;
}
use of net.runelite.api.NPC in project runelite by runelite.
the class PestControlOverlay method renderSpinners.
private void renderSpinners(Graphics2D graphics) {
Query query = new NPCQuery().nameEquals("Spinner");
NPC[] result = queryRunner.runQuery(query);
Arrays.stream(result).forEach(npc -> OverlayUtil.renderActorOverlay(graphics, npc, npc.getName(), Color.CYAN));
}
Aggregations