Search in sources :

Example 1 with EnergyReceptor

use of crazypants.enderio.powertools.machine.capbank.network.EnergyReceptor in project EnderIO by SleepyTrousers.

the class TileCapBank method updateReceptors.

private void updateReceptors() {
    if (network == null) {
        return;
    }
    network.removeReceptors(receptors);
    receptors.clear();
    for (EnumFacing dir : EnumFacing.values()) {
        IPowerInterface pi = getReceptorForFace(NullHelper.notnullJ(dir, "Enum.values()"));
        if (pi != null) {
            IoMode ioMode = getIoMode(NullHelper.notnullJ(dir, "Enum.values()"));
            if (ioMode != IoMode.DISABLED && ioMode != IoMode.PULL) {
                EnergyReceptor er = new EnergyReceptor(this, pi, NullHelper.notnullJ(dir, "Enum.values()"));
                validateModeForReceptor(er);
                receptors.add(er);
            }
        }
    }
    network.addReceptors(receptors);
    receptorsDirty = false;
}
Also used : EnergyReceptor(crazypants.enderio.powertools.machine.capbank.network.EnergyReceptor) EnumFacing(net.minecraft.util.EnumFacing) IPowerInterface(crazypants.enderio.base.power.IPowerInterface) IoMode(crazypants.enderio.base.machine.modes.IoMode)

Aggregations

IoMode (crazypants.enderio.base.machine.modes.IoMode)1 IPowerInterface (crazypants.enderio.base.power.IPowerInterface)1 EnergyReceptor (crazypants.enderio.powertools.machine.capbank.network.EnergyReceptor)1 EnumFacing (net.minecraft.util.EnumFacing)1