public static class BattleItemScanner.InventoryScanner
extends java.lang.Object
Constructor and Description |
---|
InventoryScanner(java.util.function.Predicate<net.minecraft.item.ItemStack> predicate,
BattleItemScanner.ItemScanner scanner,
BattleItemScanner.ItemFinder finder,
BattleItemScanner.ItemConsumer consumer)
Constructs a new InventoryScanner.
|
Modifier and Type | Method and Description |
---|---|
protected void |
collectItems(net.minecraft.entity.player.ServerPlayerEntity player,
BagSection section,
java.util.List<net.minecraft.item.ItemStack> inventory,
net.minecraft.item.ItemStack stack,
java.util.List<ItemData> items) |
protected net.minecraft.item.ItemStack |
consumeItem(net.minecraft.entity.player.ServerPlayerEntity player,
net.minecraft.item.ItemStack inventory,
net.minecraft.item.ItemStack toMatch) |
protected net.minecraft.item.ItemStack |
findItem(net.minecraft.entity.player.ServerPlayerEntity player,
net.minecraft.item.ItemStack inventory,
net.minecraft.item.ItemStack toMatch) |
protected boolean |
testItem(net.minecraft.item.ItemStack stack) |
public InventoryScanner(java.util.function.Predicate<net.minecraft.item.ItemStack> predicate, BattleItemScanner.ItemScanner scanner, BattleItemScanner.ItemFinder finder, BattleItemScanner.ItemConsumer consumer)
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 ItemData
s.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
.protected boolean testItem(net.minecraft.item.ItemStack stack)
protected void collectItems(net.minecraft.entity.player.ServerPlayerEntity player, BagSection section, java.util.List<net.minecraft.item.ItemStack> inventory, net.minecraft.item.ItemStack stack, java.util.List<ItemData> items)
protected net.minecraft.item.ItemStack findItem(net.minecraft.entity.player.ServerPlayerEntity player, net.minecraft.item.ItemStack inventory, net.minecraft.item.ItemStack toMatch)
protected net.minecraft.item.ItemStack consumeItem(net.minecraft.entity.player.ServerPlayerEntity player, net.minecraft.item.ItemStack inventory, net.minecraft.item.ItemStack toMatch)