Class RestockSupplies
java.lang.Object
privbot.restock.RestockSupplies
Whether the carried supplies call for a restock trip: how much food (items with an Eat action) and how many potions
(items whose name contains one of the configured names; a flask or a vial counts once whatever its doses) are left,
against the plugin's minimums. Pure: the plugin reads the inventory snapshot and asks.
An unreadable inventory decides nothing (reason(privbot.hooks.container.ItemContainerSnapshot, int, java.util.List<java.lang.String>, int) returns null): "could not read" is never "out of food".
-
Method Summary
Modifier and TypeMethodDescriptionstatic intfood(ItemContainerSnapshot inventory) Items carried with an Eat action (stack quantities summed).static intnamed(ItemContainerSnapshot inventory, List<String> fragments) Items carried whose name contains any of the names (case-insensitive).static Stringreason(ItemContainerSnapshot inventory, int minFood, List<String> potionNames, int minPotions) Why a trip is due, or null when it is not (or the inventory is unreadable).
-
Method Details
-
food
Items carried with an Eat action (stack quantities summed). -1 when the inventory is unreadable. -
named
Items carried whose name contains any of the names (case-insensitive). -1 when unreadable. -
reason
public static String reason(ItemContainerSnapshot inventory, int minFood, List<String> potionNames, int minPotions) Why a trip is due, or null when it is not (or the inventory is unreadable). Food belowminFood, or potions belowminPotions; a minimum of 0 or less turns that check off.
-