Class ItemRequirement
java.lang.Object
net.storm.api.movement.pathfinder.model.requirement.ItemRequirement
- All Implemented Interfaces:
Supplier<Boolean>,Requirement
Requirement that checks for items in inventory or equipment.
ItemRequirement verifies that specific items are present in the player's inventory, equipment, or either location. Supports AND, OR, and NONE logic for multiple item IDs.
Reduction Modes
Reduction.AND- All specified items must be presentReduction.OR- At least one item must be presentReduction.NONE- None of the items should be present
Location Options
ItemRequirement.Location.INVENTORY- Check inventory onlyItemRequirement.Location.EQUIPMENT- Check equipment onlyItemRequirement.Location.EITHER- Check both inventory and equipment
Usage Example
// Require any dramen/lunar staff in equipment or inventory
ItemRequirement fairyReq = new ItemRequirement(
Reduction.OR,
List.of(ItemID.DRAMEN_STAFF, ItemID.LUNAR_STAFF),
ItemRequirement.Location.EITHER,
1
);
// Require at least 200gp in inventory
ItemRequirement goldReq = new ItemRequirement(
Reduction.AND,
List.of(ItemID.COINS),
200
);
if (fairyReq.get()) {
// Has fairy ring staff
}
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of item check locations. -
Field Summary
Fields inherited from interface net.storm.api.movement.pathfinder.model.requirement.Requirement
ARCEUUS_FAIRY_RING, CABIN_FEVER_QUEST, DESERT_DIARY_ELITE, GRAND_TREE_QUEST, ICTHLARINS_LITTLE_HELPER, KARAMJA_DIARY_HARD, KHAREDST_PAGE_1, KHAREDST_PAGE_2, KHAREDST_PAGE_3, KHAREDST_PAGE_4, KHAREDST_PAGE_5, KUDOS_153, MONKEY_MADNESS_I, MONKEY_MADNESS_I_FINISHED, MONKEY_MADNESS_II, ONE_SMALL_FAVOUR, PANDEMONIUM_COMPLETED, PRIEST_IN_PERIL_QUEST, REGICIDE_QUEST, SONG_OF_THE_ELVES_QUEST, SUMMER_SHORE_COMPLETED, THE_GOLEM, VISITED_DEEPFIN_POINT, VISITED_KOUREND, VISITED_MORYTANIA, VISITED_PORT_ROBERTS, VISITED_VARLAMORE -
Constructor Summary
ConstructorsConstructorDescriptionItemRequirement(Reduction reduction, List<Integer> ids, int amount) Constructs an item requirement checking inventory only. -
Method Summary
-
Constructor Details
-
ItemRequirement
Constructs an item requirement checking inventory only.- Parameters:
reduction- the reduction modeids- the item IDs to checkamount- the minimum amount required
-
-
Method Details