mirror of
https://github.com/2006-Scape/Parabot-317-API-Minified.git
synced 2026-07-07 08:39:13 +00:00
Added Npcs#getClosest(Filter | int...)
This commit is contained in:
@@ -64,6 +64,32 @@ public class Npcs {
|
|||||||
public static final Npc[] getNpcs() {
|
public static final Npc[] getNpcs() {
|
||||||
return getNpcs(ALL_FILTER);
|
return getNpcs(ALL_FILTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the closest npc which matches the given filter
|
||||||
|
* @param filter
|
||||||
|
* @return closest npc
|
||||||
|
*/
|
||||||
|
public static final Npc getClosest(final Filter<Npc> filter) {
|
||||||
|
Npc[] npcs = getNearest(filter);
|
||||||
|
if(npcs == null || npcs.length == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return npcs[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the closest npc which matches the given ids
|
||||||
|
* @param ids
|
||||||
|
* @return closest npc
|
||||||
|
*/
|
||||||
|
public static final Npc getClosest(int... ids) {
|
||||||
|
Npc[] npcs = getNearest(ids);
|
||||||
|
if(npcs == null || npcs.length == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return npcs[0];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns array with the first index to be the nearest Npc
|
* Returns array with the first index to be the nearest Npc
|
||||||
|
|||||||
Reference in New Issue
Block a user