2015-07-15 00:19:44 +02:00
|
|
|
package cofh.api.energy;
|
|
|
|
|
2016-01-07 18:20:59 +01:00
|
|
|
import net.minecraft.util.EnumFacing;
|
2015-07-15 00:19:44 +02:00
|
|
|
|
2016-02-16 21:49:44 +01:00
|
|
|
|
2015-07-15 00:19:44 +02:00
|
|
|
/**
|
|
|
|
* Implement this interface on Tile Entities which should receive energy, generally storing it in one or more internal {@link IEnergyStorage} objects.
|
|
|
|
* <p>
|
|
|
|
* A reference implementation is provided {@link TileEnergyHandler}.
|
|
|
|
*
|
|
|
|
* @author King Lemming
|
|
|
|
*
|
|
|
|
*/
|
2016-02-16 21:49:44 +01:00
|
|
|
public interface IEnergyReceiver extends IEnergyHandler {
|
2015-07-15 00:19:44 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver.
|
|
|
|
*
|
|
|
|
* @param from
|
|
|
|
* Orientation the energy is received from.
|
|
|
|
* @param maxReceive
|
|
|
|
* Maximum amount of energy to receive.
|
|
|
|
* @param simulate
|
|
|
|
* If TRUE, the charge will only be simulated.
|
|
|
|
* @return Amount of energy that was (or would have been, if simulated) received.
|
|
|
|
*/
|
2016-01-07 18:20:59 +01:00
|
|
|
int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate);
|
2015-07-15 00:19:44 +02:00
|
|
|
|
|
|
|
}
|