Class BattleItemScanner.InventoryScanner

java.lang.Object
com.pixelmonmod.pixelmon.api.battles.BattleItemScanner.InventoryScanner
Enclosing class:
BattleItemScanner

public static class BattleItemScanner.InventoryScanner extends Object
Class holding functional interface instances which handle the logic of an individual inventory type.
  • Constructor Details

    • InventoryScanner

      public InventoryScanner(Predicate<net.minecraft.world.item.ItemStack> predicate, BattleItemScanner.ItemScanner scanner, BattleItemScanner.ItemFinder finder, BattleItemScanner.ItemConsumer consumer)
      Constructs a new InventoryScanner.
      Parameters:
      predicate - Predicate which returns true for any ItemStack that is of this inventory type.
      scanner - Consumer which scans for matching items, and adds them to a list of ItemDatas.
      finder - Function which finds the first matching ItemStack for a given ItemStack.
      consumer - Function which finds and consumes one of the first matching ItemStack for a given ItemStack.
  • Method Details

    • testItem

      protected boolean testItem(net.minecraft.world.item.ItemStack stack)
    • collectItems

      protected void collectItems(net.minecraft.server.level.ServerPlayer player, BagSection section, List<net.minecraft.world.item.ItemStack> inventory, net.minecraft.world.item.ItemStack stack, List<ItemData> items)
    • findItem

      protected net.minecraft.world.item.ItemStack findItem(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.item.ItemStack inventory, net.minecraft.world.item.ItemStack toMatch)
    • consumeItem

      protected net.minecraft.world.item.ItemStack consumeItem(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.item.ItemStack inventory, net.minecraft.world.item.ItemStack toMatch)