int appliedCount = 0;
int numReceptors = masterReceptors.size();
while (receptorIterator.hasNext() && canTransmit > 0 && appliedCount < numReceptors) {
Receptor receptor = receptorIterator.next();
IPowerInterface powerInterface = receptor.receptor;
IoMode mode = receptor.mode;
if(powerInterface != null
&& mode != IoMode.PULL && mode != IoMode.DISABLED
&& powerInterface.getMinEnergyReceived(receptor.fromDir.getOpposite()) <= canTransmit) {
double used;
if(receptor.receptor.getDelegate() instanceof IConduitBundle && !isCreative) {
//All other power transfer is handled by the conduit network
IConduitBundle bundle = (IConduitBundle) receptor.receptor.getDelegate();
IPowerConduit conduit = bundle.getConduit(IPowerConduit.class);
if(conduit != null && conduit.getConnectionMode(receptor.fromDir.getOpposite()) == ConnectionMode.INPUT) {
used = powerInterface.recieveEnergy(receptor.fromDir.getOpposite(), canTransmit);
} else {
used = 0;
}
} else {
used = powerInterface.recieveEnergy(receptor.fromDir.getOpposite(), canTransmit);
}
transmitted += used;
canTransmit -= used;
}