// Path: src/com/aleksey/merchants/api/ItemSlot.java
// public class ItemSlot
// {
//     public int SlotIndex;
//     public int Quantity;
//     
//     public ItemSlot(int slotIndex, int quantity)
//     {
//         SlotIndex = slotIndex;
//         Quantity = quantity;
//     }
// }
// 
// Path: src/com/aleksey/merchants/api/Point.java
// public class Point
// {
//     public int X;
//     public int Y;
//     public int Z;
//     
//     public Point(int x, int y, int z)
//     {
//         X = x;
//         Y = y;
//         Z = z;
//     }
// }


import java.util.ArrayList;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import com.aleksey.merchants.api.ItemSlot;
import com.aleksey.merchants.api.ItemTileEntity;
import com.aleksey.merchants.api.Point;
import com.bioxx.tfc.Containers.Slots.SlotLogPile;
import com.bioxx.tfc.TileEntities.TELogPile;
import com.bioxx.tfc.api.TFCBlocks;
            ItemStack itemStack,
            int requiredQuantity,
            int maxY,
            ArrayList<ItemTileEntity> resultList
            )
    {
        if(!isItemValid(tileEntity, itemStack))
            return 0;

        int freeSpace = super.searchFreeSpace(
                world,
                tileEntity,
                itemStack,
                requiredQuantity,
                maxY,
                resultList
                );
    	
    	if(freeSpace == requiredQuantity)
    		return freeSpace;
    	
    	int quantity = searchFreeSpace_LogPile(world, tileEntity, itemStack, requiredQuantity - freeSpace, maxY, resultList);
        
        return requiredQuantity - quantity;
    }
    
    @Override
    public void confirmTradeGoods(
    		World world,
    		ItemTileEntity goodTileEntity,
// Path: src/com/aleksey/merchants/api/ItemSlot.java
// public class ItemSlot
// {
//     public int SlotIndex;
//     public int Quantity;
//     
//     public ItemSlot(int slotIndex, int quantity)
//     {
//         SlotIndex = slotIndex;
//         Quantity = quantity;
//     }
// }
// 
// Path: src/com/aleksey/merchants/api/Point.java
// public class Point
// {
//     public int X;
//     public int Y;
//     public int Z;
//     
//     public Point(int x, int y, int z)
//     {
//         X = x;
//         Y = y;
//         Z = z;
//     }
// }


// Path: src/com/aleksey/merchants/WarehouseContainers/LogPileContainer.java
import java.util.ArrayList;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import com.aleksey.merchants.api.ItemSlot;
import com.aleksey.merchants.api.ItemTileEntity;
import com.aleksey.merchants.api.Point;
import com.bioxx.tfc.Containers.Slots.SlotLogPile;
import com.bioxx.tfc.TileEntities.TELogPile;
import com.bioxx.tfc.api.TFCBlocks;

            ItemStack itemStack,
            int requiredQuantity,
            int maxY,
            ArrayList<ItemTileEntity> resultList
            )
    {
        if(!isItemValid(tileEntity, itemStack))
            return 0;

        int freeSpace = super.searchFreeSpace(
                world,
                tileEntity,
                itemStack,
                requiredQuantity,
                maxY,
                resultList
                );
    	
    	if(freeSpace == requiredQuantity)
    		return freeSpace;
    	
    	int quantity = searchFreeSpace_LogPile(world, tileEntity, itemStack, requiredQuantity - freeSpace, maxY, resultList);
        
        return requiredQuantity - quantity;
    }
    
    @Override
    public void confirmTradeGoods(
    		World world,
    		ItemTileEntity goodTileEntity,
    		ItemStack goodItemStack