Class InventoryFoodQueries
java.lang.Object
privbot.hooks.InventoryFoodQueries
Modular inventory food resolution: Inventory query plus Eat (Warden-style),
optional name-pattern tier when composition actions are wrong, then item-id fallback.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PrivItemfirstByNamePatternsPreferEat(Inventory inventory, String... namePatterns) The first carried item whose name contains one ofnamePatterns, preferring items that listEAT_ACTION(for servers whose item definitions report wrong actions); lowest potion dose, then lowest slot, first.static PrivItemfirstWithEatAction(Inventory inventory) The first carried item (no placeholders) whose actions includeEAT_ACTION.static booleantryInteractEat(PrivItem food) Dispatches "Eat" onfood.
-
Field Details
-
EAT_ACTION
-
DEFAULT_COOKED_FOOD_NAME_PATTERNS
Default cooked-food name substrings (contains, case-insensitive). Single place to extend.
-
-
Method Details
-
firstWithEatAction
The first carried item (no placeholders) whose actions includeEAT_ACTION.- Parameters:
inventory-ctx.inventory- Returns:
- the item, or null when none (or no inventory)
-
firstByNamePatternsPreferEat
The first carried item whose name contains one ofnamePatterns, preferring items that listEAT_ACTION(for servers whose item definitions report wrong actions); lowest potion dose, then lowest slot, first.- Parameters:
inventory-ctx.inventorynamePatterns- case-insensitive name substrings- Returns:
- the item, or null
-
tryInteractEat
Dispatches "Eat" onfood.- Parameters:
food- the item, may be null- Returns:
- dispatch acceptance (false for null); verify HP rose or the item was consumed
-