package com.raoulvdberge.refinedstorage.integration.oc;

import com.raoulvdberge.refinedstorage.capability.CapabilityNetworkNodeProxy;
import li.cil.oc.api.Driver;
import li.cil.oc.api.driver.DriverBlock;
import li.cil.oc.api.network.ManagedEnvironment;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class DriverNetwork implements DriverBlock {
    @Override
    public boolean worksWith(World world, BlockPos pos, EnumFacing facing) {
        TileEntity tile = world.getTileEntity(pos);

        return tile != null && tile.hasCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, facing);
    }

    @Override
    public ManagedEnvironment createEnvironment(World world, BlockPos pos, EnumFacing facing) {
        return new EnvironmentNetwork(world.getTileEntity(pos).getCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, facing).getNode());
    }

    public static void register() {
        Driver.add(new DriverNetwork());

        Driver.add(new ConverterCraftingPattern());
        Driver.add(new ConverterCraftingTask());
    }
}

@@ -50,16 +50,77 @@
 on.oc;%0A%0A
+import com.raoulvdberge.refinedstorage.api.network.INetwork;%0A
 import c
@@ -658,24 +658,189 @@
 tity(pos);%0A%0A
+        // Avoid bug #1855 (https://github.com/raoulvdberge/refinedstorage/issues/1855)%0A        if (tile instanceof INetwork) %7B%0A            return false;%0A        %7D%0A%0A
         retu

Should fix #1855