2013-04-13 16:35:13 +02:00
|
|
|
package ic2.api.energy.tile;
|
|
|
|
|
2013-08-22 17:36:31 +02:00
|
|
|
import net.minecraftforge.common.ForgeDirection;
|
2013-04-13 16:35:13 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Allows a tile entity (mostly a machine) to receive energy.
|
2013-08-22 17:36:31 +02:00
|
|
|
*
|
|
|
|
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
|
2013-04-13 16:35:13 +02:00
|
|
|
*/
|
|
|
|
public interface IEnergySink extends IEnergyAcceptor {
|
|
|
|
/**
|
|
|
|
* Determine how much energy the sink accepts.
|
|
|
|
*
|
|
|
|
* This value is unrelated to getMaxSafeInput().
|
|
|
|
*
|
|
|
|
* Make sure that injectEnergy() does accepts energy if demandsEnergy() returns anything > 0.
|
|
|
|
*
|
|
|
|
* @return max accepted input in eu
|
|
|
|
*/
|
2013-08-22 17:36:31 +02:00
|
|
|
double demandedEnergyUnits();
|
2013-04-13 16:35:13 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Transfer energy to the sink.
|
2013-08-30 00:57:13 +02:00
|
|
|
*
|
|
|
|
* It's highly recommended to accept all energy by letting the internal buffer overflow to
|
|
|
|
* increase the performance and accuracy of the distribution simulation.
|
2013-04-13 16:35:13 +02:00
|
|
|
*
|
|
|
|
* @param directionFrom direction from which the energy comes from
|
|
|
|
* @param amount energy to be transferred
|
|
|
|
* @return Energy not consumed (leftover)
|
|
|
|
*/
|
2013-08-22 17:36:31 +02:00
|
|
|
double injectEnergyUnits(ForgeDirection directionFrom, double amount);
|
2013-04-13 16:35:13 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine the amount of eu which can be safely injected into the specific energy sink without exploding.
|
|
|
|
*
|
|
|
|
* Typical values are 32 for LV, 128 for MV, 512 for HV and 2048 for EV. A value of Integer.MAX_VALUE indicates no
|
|
|
|
* limit.
|
|
|
|
*
|
|
|
|
* This value is unrelated to demandsEnergy().
|
|
|
|
*
|
|
|
|
* @return max safe input in eu
|
|
|
|
*/
|
|
|
|
int getMaxSafeInput();
|
|
|
|
}
|
|
|
|
|