2013-05-07 22:12:07 +02:00
|
|
|
package ic2.api.tile;
|
|
|
|
|
2013-08-22 17:36:31 +02:00
|
|
|
import net.minecraftforge.common.ForgeDirection;
|
2013-04-13 16:35:13 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface implemented by the tile entity of energy storage blocks.
|
|
|
|
*/
|
|
|
|
public interface IEnergyStorage {
|
|
|
|
/**
|
|
|
|
* Get the amount of energy currently stored in the block.
|
|
|
|
*
|
|
|
|
* @return Energy stored in the block
|
|
|
|
*/
|
|
|
|
public int getStored();
|
2013-08-22 17:36:31 +02:00
|
|
|
|
2013-04-13 16:35:13 +02:00
|
|
|
/**
|
|
|
|
* Set the amount of energy currently stored in the block.
|
2013-08-22 17:36:31 +02:00
|
|
|
*
|
2013-04-13 16:35:13 +02:00
|
|
|
* @param energy stored energy
|
|
|
|
*/
|
|
|
|
public void setStored(int energy);
|
2013-08-22 17:36:31 +02:00
|
|
|
|
2013-04-13 16:35:13 +02:00
|
|
|
/**
|
|
|
|
* Add the specified amount of energy.
|
|
|
|
*
|
|
|
|
* Use negative values to decrease.
|
|
|
|
*
|
|
|
|
* @param amount of energy to add
|
|
|
|
* @return Energy stored in the block after adding the specified amount
|
|
|
|
*/
|
|
|
|
public int addEnergy(int amount);
|
2013-08-22 17:36:31 +02:00
|
|
|
|
2013-04-13 16:35:13 +02:00
|
|
|
/**
|
|
|
|
* Get the maximum amount of energy the block can store.
|
|
|
|
*
|
|
|
|
* @return Maximum energy stored
|
|
|
|
*/
|
|
|
|
public int getCapacity();
|
2013-08-22 17:36:31 +02:00
|
|
|
|
2013-04-13 16:35:13 +02:00
|
|
|
/**
|
|
|
|
* Get the block's energy output.
|
|
|
|
*
|
|
|
|
* @return Energy output in EU/t
|
|
|
|
*/
|
|
|
|
public int getOutput();
|
2013-08-22 17:36:31 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the block's energy output.
|
|
|
|
*
|
|
|
|
* @return Energy output in EU/t
|
|
|
|
*/
|
|
|
|
public double getOutputEnergyUnitsPerTick();
|
|
|
|
|
2013-04-13 16:35:13 +02:00
|
|
|
/**
|
|
|
|
* Get whether this block can have its energy used by an adjacent teleporter.
|
|
|
|
*
|
|
|
|
* @param side side the teleporter is draining energy from
|
|
|
|
* @return Whether the block is teleporter compatible
|
|
|
|
*/
|
2013-08-22 17:36:31 +02:00
|
|
|
public boolean isTeleporterCompatible(ForgeDirection side);
|
2013-04-13 16:35:13 +02:00
|
|
|
}
|