Prevent IC2 double-outputting.

This commit is contained in:
Ben Spiers 2014-10-02 18:42:04 +01:00
parent f0b7f342b8
commit 4f41f5a1df
2 changed files with 55 additions and 1 deletions

View file

@ -0,0 +1,53 @@
package ic2.api.energy.tile;
/**
* Tile entities which conduct energy pulses without buffering (mostly cables) have to implement this
* interface.
*
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
*/
public interface IEnergyConductor extends IEnergyAcceptor, IEnergyEmitter {
/**
* Energy loss for the conductor in EU per block.
*
* @return Energy loss
*/
double getConductionLoss();
/**
* Amount of energy the insulation will handle before shocking nearby players and mobs.
*
* @return Insulation energy absorption in EU
*/
double getInsulationEnergyAbsorption();
/**
* Amount of energy the insulation will handle before it is destroyed.
* Ensure that this value is greater than the insulation energy absorption + 64.
*
* @return Insulation-destroying energy in EU
*/
double getInsulationBreakdownEnergy();
/**
* Amount of energy the conductor will handle before it melts.
*
* @return Conductor-destroying energy in EU
*/
double getConductorBreakdownEnergy();
/**
* Remove the conductor's insulation if the insulation breakdown energy was exceeded.
*
* @see #getInsulationBreakdownEnergy()
*/
void removeInsulation();
/**
* Remove the conductor if the conductor breakdown energy was exceeded.
*
* @see #getConductorBreakdownEnergy()
*/
void removeConductor();
}

View file

@ -3,6 +3,7 @@ package mekanism.common.tile;
import ic2.api.energy.EnergyNet;
import ic2.api.energy.event.EnergyTileLoadEvent;
import ic2.api.energy.event.EnergyTileUnloadEvent;
import ic2.api.energy.tile.IEnergyConductor;
import ic2.api.energy.tile.IEnergySink;
import ic2.api.energy.tile.IEnergySource;
import ic2.api.energy.tile.IEnergyTile;
@ -375,7 +376,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
@Method(modid = "IC2")
public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction)
{
return getOutputtingSides().contains(direction);
return getOutputtingSides().contains(direction) && receiver instanceof IEnergyConductor;
}
@Override