Examples of ArrayStackFilter


Examples of forestry.core.inventory.filters.ArrayStackFilter

   * @param dest
   * @param filer an ItemStack[] to match against
   * @return null if nothing was moved, the stack moved otherwise
   */
  public static ItemStack moveOneItem(IInventory source, IInventory dest, ItemStack... filters) {
    return moveOneItem(source, dest, new ArrayStackFilter(filters));
  }
View Full Code Here

Examples of forestry.core.inventory.filters.ArrayStackFilter

   * @param dest
   * @param filer an ItemStack[] to exclude
   * @return null if nothing was moved, the stack moved otherwise
   */
  public static ItemStack moveOneItemExcept(IInventory source, IInventory dest, ItemStack... filters) {
    return moveOneItem(source, dest, new InvertedStackFilter(new ArrayStackFilter(filters)));
  }
View Full Code Here

Examples of forestry.core.inventory.filters.ArrayStackFilter

   * @param inv The inventory
   * @param filter ItemStack to match against
   * @return An ItemStack
   */
  public static ItemStack removeOneItem(IInventory inv, ItemStack... filter) {
    return removeOneItem(inv, new ArrayStackFilter(filter));
  }
View Full Code Here

Examples of mods.railcraft.common.util.inventory.filters.ArrayStackFilter

     * @param inv
     * @param filters
     * @return
     */
    public static int countItems(IInventory inv, ItemStack... filters) {
        return countItems(inv, new ArrayStackFilter(filters));
    }
View Full Code Here

Examples of mods.railcraft.common.util.inventory.filters.ArrayStackFilter

     * @param dest
     * @param filters ItemStack to match against
     * @return null if nothing was moved, the stack moved otherwise
     */
    public static ItemStack moveOneItem(IInventory source, IInventory dest, ItemStack... filters) {
        return moveOneItem(source, dest, new ArrayStackFilter(filters));
    }
View Full Code Here

Examples of mods.railcraft.common.util.inventory.filters.ArrayStackFilter

     * @param dest
     * @param filters an ItemStack[] to exclude
     * @return null if nothing was moved, the stack moved otherwise
     */
    public static ItemStack moveOneItemExcept(IInventory source, IInventory dest, ItemStack... filters) {
        return moveOneItem(source, dest, new InvertedStackFilter(new ArrayStackFilter(filters)));
    }
View Full Code Here

Examples of mods.railcraft.common.util.inventory.filters.ArrayStackFilter

     * @param inv    The inventory
     * @param filter ItemStack to match against
     * @return An ItemStack
     */
    public static ItemStack removeOneItem(IInventory inv, ItemStack... filter) {
        return removeOneItem(inv, new ArrayStackFilter(filter));
    }
View Full Code Here

Examples of mods.railcraft.common.util.inventory.filters.ArrayStackFilter

     * @param filter
     * @return true if there are enough items that can be removed, false
     *         otherwise.
     */
    public static boolean removeItemsAbsolute(IInventory inv, int amount, ItemStack... filter) {
        return removeItemsAbsolute(inv, amount, new ArrayStackFilter(filter));
    }
View Full Code Here

Examples of mods.railcraft.common.util.inventory.filters.ArrayStackFilter

    private void findMoreStuff() {
        Collection<IInventory> chests = cache.getAdjecentInventories();
        for (IInvSlot slot : InventoryIterator.getIterable(craftMatrix)) {
            ItemStack stack = slot.getStackInSlot();
            if (stack != null && stack.isStackable() && stack.stackSize == 1) {
                ItemStack request = InvTools.removeOneItem(chests, new ArrayStackFilter(stack));
                if (request != null) {
                    stack.stackSize++;
                    break;
                }
                if (stack.stackSize > 1)
View Full Code Here

Examples of mods.railcraft.common.util.inventory.filters.ArrayStackFilter

        return requestItem(this, StackFilter.ALL);
    }

    @Override
    public ItemStack requestItem(Object source, ItemStack request) {
        return requestItem(this, new ArrayStackFilter(request));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.