/
IEnergySink.java
45 lines (40 loc) · 1.31 KB
/
IEnergySink.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package ic2.api.energy.tile;
import net.minecraftforge.common.util.ForgeDirection;
/**
* Allows a tile entity (mostly a machine) to receive energy.
*
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
*/
public interface IEnergySink extends IEnergyAcceptor {
/**
* Determine how much energy the sink accepts.
*
* Make sure that injectEnergy() does accepts energy if demandsEnergy() returns anything > 0.
*
* @note Modifying the energy net from this method is disallowed.
*
* @return max accepted input in eu
*/
double getDemandedEnergy();
/**
* Determine the tier of this energy sink.
* 1 = LV, 2 = MV, 3 = HV, 4 = EV etc.
*
* @note Modifying the energy net from this method is disallowed.
* @note Return Integer.MAX_VALUE to allow any voltage.
*
* @return tier of this energy sink
*/
int getSinkTier();
/**
* Transfer energy to the sink.
*
* 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)
*/
double injectEnergy(ForgeDirection directionFrom, double amount, double voltage);
}