Class RestockSupplies

java.lang.Object
privbot.restock.RestockSupplies

public final class RestockSupplies extends Object
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 Details

    • food

      public static int food(ItemContainerSnapshot inventory)
      Items carried with an Eat action (stack quantities summed). -1 when the inventory is unreadable.
    • named

      public static int named(ItemContainerSnapshot inventory, List<String> fragments)
      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 below minFood, or potions below minPotions; a minimum of 0 or less turns that check off.