resonant-induction/APIs/ic2/api/energy/tile/IEnergySink.java

47 lines
1.4 KiB
Java
Raw Normal View History

package ic2.api.energy.tile;
2013-08-26 19:36:24 +02:00
import net.minecraftforge.common.ForgeDirection;
/**
* Allows a tile entity (mostly a machine) to receive energy.
2013-08-26 19:36:24 +02:00
*
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
*/
2013-10-12 12:12:59 +02:00
public interface IEnergySink extends IEnergyAcceptor {
/**
* Determine how much energy the sink accepts.
2013-10-12 12:12:59 +02:00
*
* This value is unrelated to getMaxSafeInput().
2013-10-12 12:12:59 +02:00
*
* Make sure that injectEnergy() does accepts energy if demandsEnergy() returns anything > 0.
2013-10-12 12:12:59 +02:00
*
* @return max accepted input in eu
*/
2013-08-26 19:36:24 +02:00
double demandedEnergyUnits();
/**
* Transfer energy to the sink.
*
2013-10-12 12:12:59 +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.
*
* @param directionFrom direction from which the energy comes from
* @param amount energy to be transferred
* @return Energy not consumed (leftover)
*/
2013-08-26 19:36:24 +02:00
double injectEnergyUnits(ForgeDirection directionFrom, double amount);
/**
2013-10-12 12:12:59 +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().
2013-10-12 12:12:59 +02:00
*
* @return max safe input in eu
*/
int getMaxSafeInput();
}
2013-10-12 12:12:59 +02:00