ItemSpawnQuery
Query builder for static item spawn metadata.
ClassRLPlugins API
public class ItemSpawnQuery extends AbstractQuery<ItemSpawn, ItemSpawnQuery>Members
Constructors
- newItemSpawnQuery(List<ItemSpawn>)
Creates a ItemSpawnQuery.
Methods
- ItemSpawnQueryatLocation(WorldPoint)
At location.
- ItemSpawnQueryinLocation(String...)
In location.
- ItemSpawnQuerylocationContains(String...)
Location contains.
- ItemSpawnnearest()
Nearest.
- ItemSpawnnearest(WorldPoint)
Nearest.
- ItemSpawnQueryonPlane(int)
On plane.
- ItemSpawnshortestPath()
Shortest path.
- ItemSpawnQuerysortNearest()
Sort nearest.
- ItemSpawnQuerysortNearest(WorldPoint)
Sort nearest.
- ItemSpawnQuerysortShortestPath()
Sort shortest path.
- ItemSpawnQuerysortShortestPath(WorldPoint)
Sort shortest path.
- ItemSpawnQuerywithId(int...)
With id.
- ItemSpawnQuerywithin(int)
Within.
- ItemSpawnQuerywithin(WorldPoint, int)
Within.
- ItemSpawnQuerywithName(String...)
With name.
- ItemSpawnQuerywithNameContains(String...)
With name contains.
Inherited from AbstractQuery
- Raggregate(Function<Stream<ItemSpawn>, R>)
Generic aggregation method for custom terminal operations Executes filters and allows custom stream processing.
- booleanall(Predicate<ItemSpawn>)
Check if all filtered results match the predicate.
- booleanany(Predicate<ItemSpawn>)
Check if any filtered result matches the predicate.
- List<ItemSpawn>collect()
Get the filtered/sorted list.
- Rcollect(Collector<ItemSpawn, ?, R>)
Execute filters and process with custom collector.
- intcount()
Get count of filtered results.
- ItemSpawnQuerydistinct()
Ensure results are distinct.
- ItemSpawnfirst()
Get the first element from the filtered/sorted list.
- voidfirstIfPresent(Consumer<ItemSpawn>)
First if present.
- voidfirstOrElse(Consumer<ItemSpawn>, Runnable)
Perform action on the first element, or else run elseAction if no results.
- voidforEach(Consumer<ItemSpawn>)
Executes filters and performs an action on each result.
- booleanisEmpty()
Check if there are no filtered results.
- ItemSpawnQuerykeepIf(Predicate<ItemSpawn>)
Lazily filter by predicate (keeps matching items).
- ItemSpawnlast()
Get the last element from the filtered/sorted list.
- voidlastOrElse(Consumer<ItemSpawn>, Runnable)
Perform action on the last element, or else run elseAction if no results.
- ItemSpawnQuerylimit(int)
Limit the number of results.
- booleannone(Predicate<ItemSpawn>)
Check if no filtered results match the predicate.
- ItemSpawnQuerypeek(Consumer<ItemSpawn>)
Peek at each element during processing.
- ItemSpawnQuerypostProcess(Function<List<ItemSpawn>, List<ItemSpawn>>)
Apply a post-processing function after sorting.
- ItemSpawnrandom()
Get a random element from the filtered/sorted list.
- ItemSpawnQueryremoveIf(Predicate<ItemSpawn>)
Lazily filter by predicate (removes matching items).
- ItemSpawnQueryskip(int)
Skip a number of results.
- ItemSpawnQuerysort(Comparator<ItemSpawn>)
Lazily add sorting.
ItemSpawnQuery(List<ItemSpawn>)
public ItemSpawnQuery(List<ItemSpawn> spawns)Creates a ItemSpawnQuery.
Parameters
spawns- Spawns.
atLocation(WorldPoint)
public ItemSpawnQuery atLocation(WorldPoint worldPoint)At location.
Parameters
worldPoint- World point.
inLocation(String...)
public ItemSpawnQuery inLocation(String... locations)In location.
Parameters
locations- Locations.
locationContains(String...)
public ItemSpawnQuery locationContains(String... locations)Location contains.
Parameters
locations- Locations.
nearest()
public ItemSpawn nearest()Nearest.
nearest(WorldPoint)
public ItemSpawn nearest(WorldPoint center)Nearest.
Parameters
center- Center.
onPlane(int)
public ItemSpawnQuery onPlane(int plane)On plane.
Parameters
plane- Plane.
shortestPath()
public ItemSpawn shortestPath()Shortest path.
sortNearest()
public ItemSpawnQuery sortNearest()Sort nearest.
sortNearest(WorldPoint)
public ItemSpawnQuery sortNearest(WorldPoint center)Sort nearest.
Parameters
center- Center.
sortShortestPath()
public ItemSpawnQuery sortShortestPath()Sort shortest path.
sortShortestPath(WorldPoint)
public ItemSpawnQuery sortShortestPath(WorldPoint center)Sort shortest path.
Parameters
center- Center.
withId(int...)
public ItemSpawnQuery withId(int... itemIds)With id.
Parameters
itemIds- Item ids.
within(int)
public ItemSpawnQuery within(int distance)Within.
Parameters
distance- Distance.
within(WorldPoint, int)
public ItemSpawnQuery within(WorldPoint center, int distance)Within.
Parameters
center- Center.
distance- Distance.
withName(String...)
public ItemSpawnQuery withName(String... names)With name.
Parameters
names- Names.
withNameContains(String...)
public ItemSpawnQuery withNameContains(String... names)With name contains.
Parameters
names- Names.
aggregate(Function<Stream<ItemSpawn>, R>)from AbstractQuery
public R aggregate(Function<Stream<ItemSpawn>, R> aggregator)Generic aggregation method for custom terminal operations Executes filters and allows custom stream processing.
Parameters
aggregator- Aggregator.
all(Predicate<ItemSpawn>)from AbstractQuery
public boolean all(Predicate<ItemSpawn> predicate)Check if all filtered results match the predicate.
Parameters
predicate- Predicate to test.
Returns
True if all match, false otherwise.
any(Predicate<ItemSpawn>)from AbstractQuery
public boolean any(Predicate<ItemSpawn> predicate)Check if any filtered result matches the predicate.
Parameters
predicate- Predicate to test.
Returns
True if any match, false otherwise.
collect()from AbstractQuery
public List<ItemSpawn> collect()Get the filtered/sorted list.
collect(Collector<ItemSpawn, ?, R>)from AbstractQuery
public R collect(Collector<ItemSpawn, ?, R> collector)Execute filters and process with custom collector.
Parameters
collector- Collector.
count()from AbstractQuery
public int count()Get count of filtered results.
distinct()from AbstractQuery
public ItemSpawnQuery distinct()Ensure results are distinct.
Returns
The query instance.
first()from AbstractQuery
public ItemSpawn first()Get the first element from the filtered/sorted list.
firstIfPresent(Consumer<ItemSpawn>)from AbstractQuery
public void firstIfPresent(Consumer<ItemSpawn> action)First if present.
Parameters
action- Action.
firstOrElse(Consumer<ItemSpawn>, Runnable)from AbstractQuery
public void firstOrElse(Consumer<ItemSpawn> action, Runnable elseAction)Perform action on the first element, or else run elseAction if no results.
Parameters
action- Action to perform on the first element.
elseAction- Action to perform if no results.
forEach(Consumer<ItemSpawn>)from AbstractQuery
public void forEach(Consumer<ItemSpawn> action)Executes filters and performs an action on each result.
Parameters
action- Action.
isEmpty()from AbstractQuery
public boolean isEmpty()Check if there are no filtered results.
Returns
True if no results after filtering, false otherwise.
keepIf(Predicate<ItemSpawn>)from AbstractQuery
public ItemSpawnQuery keepIf(Predicate<ItemSpawn> predicate)Lazily filter by predicate (keeps matching items).
Parameters
predicate- Predicate.
Returns
The query instance.
last()from AbstractQuery
public ItemSpawn last()Get the last element from the filtered/sorted list.
lastOrElse(Consumer<ItemSpawn>, Runnable)from AbstractQuery
public void lastOrElse(Consumer<ItemSpawn> action, Runnable elseAction)Perform action on the last element, or else run elseAction if no results.
Parameters
action- Action to perform on the last element.
elseAction- Action to perform if no results.
limit(int)from AbstractQuery
public ItemSpawnQuery limit(int maxSize)Limit the number of results.
Parameters
maxSize- Max size.
Returns
The query instance.
none(Predicate<ItemSpawn>)from AbstractQuery
public boolean none(Predicate<ItemSpawn> predicate)Check if no filtered results match the predicate.
Parameters
predicate- Predicate to test.
Returns
True if none match, false otherwise.
peek(Consumer<ItemSpawn>)from AbstractQuery
public ItemSpawnQuery peek(Consumer<ItemSpawn> action)Peek at each element during processing.
Parameters
action- Action to perform on each element.
Returns
The query instance.
postProcess(Function<List<ItemSpawn>, List<ItemSpawn>>)from AbstractQuery
public ItemSpawnQuery postProcess(Function<List<ItemSpawn>, List<ItemSpawn>> processor)Apply a post-processing function after sorting.
Useful for reordering algorithms that can't be expressed as Comparators.
Parameters
processor- Function to transform the result list.
Returns
The query instance.
random()from AbstractQuery
public ItemSpawn random()Get a random element from the filtered/sorted list.
removeIf(Predicate<ItemSpawn>)from AbstractQuery
public ItemSpawnQuery removeIf(Predicate<ItemSpawn> predicate)Lazily filter by predicate (removes matching items).
Parameters
predicate- Predicate.
Returns
The query instance.
skip(int)from AbstractQuery
public ItemSpawnQuery skip(int count)Skip a number of results.
Parameters
count- Count.
Returns
The query instance.
sort(Comparator<ItemSpawn>)from AbstractQuery
public ItemSpawnQuery sort(Comparator<ItemSpawn> comparator)Lazily add sorting.
Parameters
comparator- Comparator.
Returns
The query instance.
Also allowed
Every class has these, as in plain Java.
equals, toString