Search in sources :

Example 1 with ExtractionMode

use of logisticspipes.logisticspipes.ExtractionMode in project LogisticsPipes by RS485.

the class PipeItemsProviderLogistics method getAdaptedInventoryUtil.

private IInventoryUtil getAdaptedInventoryUtil(AdjacentTileEntity adjacent) {
    IInventory base = (IInventory) adjacent.tileEntity;
    if (base instanceof net.minecraft.inventory.ISidedInventory) {
        base = new SidedInventoryMinecraftAdapter((net.minecraft.inventory.ISidedInventory) base, adjacent.direction.getOpposite(), true);
    }
    ExtractionMode mode = getExtractionMode();
    switch(mode) {
        case LeaveFirst:
            return SimpleServiceLocator.inventoryUtilFactory.getHidingInventoryUtil(base, adjacent.direction.getOpposite(), false, false, 1, 0);
        case LeaveLast:
            return SimpleServiceLocator.inventoryUtilFactory.getHidingInventoryUtil(base, adjacent.direction.getOpposite(), false, false, 0, 1);
        case LeaveFirstAndLast:
            return SimpleServiceLocator.inventoryUtilFactory.getHidingInventoryUtil(base, adjacent.direction.getOpposite(), false, false, 1, 1);
        case Leave1PerStack:
            return SimpleServiceLocator.inventoryUtilFactory.getHidingInventoryUtil(base, adjacent.direction.getOpposite(), true, false, 0, 0);
        case Leave1PerType:
            return SimpleServiceLocator.inventoryUtilFactory.getHidingInventoryUtil(base, adjacent.direction.getOpposite(), false, true, 0, 0);
        default:
            break;
    }
    return SimpleServiceLocator.inventoryUtilFactory.getHidingInventoryUtil(base, adjacent.direction.getOpposite(), false, false, 0, 0);
}
Also used : IInventory(net.minecraft.inventory.IInventory) SidedInventoryMinecraftAdapter(logisticspipes.utils.SidedInventoryMinecraftAdapter) ExtractionMode(logisticspipes.logisticspipes.ExtractionMode)

Aggregations

ExtractionMode (logisticspipes.logisticspipes.ExtractionMode)1 SidedInventoryMinecraftAdapter (logisticspipes.utils.SidedInventoryMinecraftAdapter)1 IInventory (net.minecraft.inventory.IInventory)1