package com.raoulvdberge.refinedstorage.inventory;

import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;

import javax.annotation.Nonnull;

public class ItemHandlerInterface implements IItemHandler {
    private IItemHandler importItems;
    private IItemHandler exportItems;

    public ItemHandlerInterface(IItemHandler importItems, IItemHandler exportItems) {
        this.importItems = importItems;
        this.exportItems = exportItems;
    }

    @Override
    public int getSlots() {
        return importItems.getSlots() + exportItems.getSlots();
    }

    @Nonnull
    @Override
    public ItemStack getStackInSlot(int slot) {
        return slot < 9 ? importItems.getStackInSlot(slot) : exportItems.getStackInSlot(slot - 9);
    }

    @Nonnull
    @Override
    public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
        return slot < 9 ? importItems.insertItem(slot, stack, simulate) : stack;
    }

    @Nonnull
    @Override
    public ItemStack extractItem(int slot, int amount, boolean simulate) {
        return slot >= 9 ? exportItems.extractItem(slot - 9, amount, simulate) : ItemStack.EMPTY;
    }

    @Override
    public int getSlotLimit(int slot) {
        return slot < 9 ? importItems.getSlotLimit(slot) : exportItems.getSlotLimit(slot - 9);
    }
}

@@ -675,33 +675,54 @@
   return slot %3C 
-9
+importItems.getSlots()
  ? importItems.g
@@ -769,33 +769,54 @@
 ckInSlot(slot - 
-9
+importItems.getSlots()
 );%0A    %7D%0A%0A    @N
@@ -938,33 +938,54 @@
   return slot %3C 
-9
+importItems.getSlots()
  ? importItems.i
@@ -1158,17 +1158,38 @@
 slot %3E= 
-9
+importItems.getSlots()
  ? expor
@@ -1214,17 +1214,38 @@
 (slot - 
-9
+importItems.getSlots()
 , amount
@@ -1358,17 +1358,38 @@
  slot %3C 
-9
+importItems.getSlots()
  ? impor
@@ -1452,9 +1452,30 @@
 t - 
-9
+importItems.getSlots()
 );%0A 

Remove hardcoding