Search in sources :

Example 11 with IConductor

use of micdoodle8.mods.galacticraft.api.transmission.tile.IConductor in project Galacticraft by micdoodle8.

the class EnergyNetwork method refreshAcceptors.

/**
 * Refresh all energy acceptors in the network
 */
private void refreshAcceptors() {
    this.connectedAcceptors.clear();
    this.connectedDirections.clear();
    this.refreshWithChecks();
    try {
        LinkedList<IConductor> conductorsCopy = new LinkedList<>();
        conductorsCopy.addAll(this.conductors);
        // (Chunk loading can change the network if new conductors are found)
        for (IConductor conductor : conductorsCopy) {
            EnergyUtil.setAdjacentPowerConnections((TileEntity) conductor, this.connectedAcceptors, this.connectedDirections);
        }
    } catch (Exception e) {
        FMLLog.severe("GC Aluminium Wire: Error when testing whether another mod's tileEntity can accept energy.");
        e.printStackTrace();
    }
}
Also used : IConductor(micdoodle8.mods.galacticraft.api.transmission.tile.IConductor)

Aggregations

IConductor (micdoodle8.mods.galacticraft.api.transmission.tile.IConductor)11 TileEntity (net.minecraft.tileentity.TileEntity)10 BlockVec3 (micdoodle8.mods.galacticraft.api.vector.BlockVec3)6 EnumFacing (net.minecraft.util.EnumFacing)4 World (net.minecraft.world.World)4 BlockPos (net.minecraft.util.BlockPos)3 IEnergyConnection (cofh.api.energy.IEnergyConnection)2 IEnergyHandler (cofh.api.energy.IEnergyHandler)2 IEnergyReceiver (cofh.api.energy.IEnergyReceiver)2 IStrictEnergyAcceptor (mekanism.api.energy.IStrictEnergyAcceptor)2 IEnergyProvider (cofh.api.energy.IEnergyProvider)1 Field (java.lang.reflect.Field)1 ICableOutputter (mekanism.api.energy.ICableOutputter)1 IElectricityNetwork (micdoodle8.mods.galacticraft.api.transmission.grid.IElectricityNetwork)1 IConnector (micdoodle8.mods.galacticraft.api.transmission.tile.IConnector)1 IElectrical (micdoodle8.mods.galacticraft.api.transmission.tile.IElectrical)1 INetworkConnection (micdoodle8.mods.galacticraft.api.transmission.tile.INetworkConnection)1 EnergyStorageTile (micdoodle8.mods.galacticraft.core.energy.tile.EnergyStorageTile)1