Search in sources :

Example 1 with IPowerConduit

use of crazypants.enderio.conduits.conduit.power.IPowerConduit in project EnderIO by SleepyTrousers.

the class CapBankNetwork method sendPowerTo.

private int sendPowerTo(EnergyReceptor next, int available) {
    // Can only send to power conduits if we are in push mode or the conduit is in pull mode
    // With default setting interaction between conduits and Cap Banks is handled by NetworkPowerManager
    IPowerConduit con = next.getConduit();
    if (con != null && next.getMode() == IoMode.NONE && con.getConnectionMode(next.getDir().getOpposite()) == ConnectionMode.IN_OUT) {
        return 0;
    }
    IPowerInterface inf = next.getReceptor();
    int result = inf.receiveEnergy(available, false);
    if (result < 0) {
        result = 0;
    }
    return result;
}
Also used : IPowerInterface(crazypants.enderio.base.power.IPowerInterface) IPowerConduit(crazypants.enderio.conduits.conduit.power.IPowerConduit)

Aggregations

IPowerInterface (crazypants.enderio.base.power.IPowerInterface)1 IPowerConduit (crazypants.enderio.conduits.conduit.power.IPowerConduit)1