2013-04-13 16:35:13 +02:00
|
|
|
package universalelectricity.core.item;
|
|
|
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
2013-07-27 00:16:21 +02:00
|
|
|
|
|
|
|
public interface IItemElectric
|
2013-04-13 16:35:13 +02:00
|
|
|
{
|
|
|
|
/**
|
2013-07-27 00:16:21 +02:00
|
|
|
* Adds energy to an item. Returns the quantity of energy that was accepted. This should always
|
|
|
|
* return 0 if the item cannot be externally charged.
|
2013-04-13 16:35:13 +02:00
|
|
|
*
|
2013-07-27 00:16:21 +02:00
|
|
|
* @param itemStack ItemStack to be charged.
|
|
|
|
* @param energy Maximum amount of energy to be sent into the item.
|
|
|
|
* @param doRecharge If false, the charge will only be simulated.
|
|
|
|
* @return Amount of energy that was accepted by the item.
|
2013-04-13 16:35:13 +02:00
|
|
|
*/
|
2013-07-27 00:16:21 +02:00
|
|
|
public float recharge(ItemStack itemStack, float energy, boolean doRecharge);
|
2013-04-13 16:35:13 +02:00
|
|
|
|
|
|
|
/**
|
2013-07-27 00:16:21 +02:00
|
|
|
* Removes energy from an item. Returns the quantity of energy that was removed. This should
|
|
|
|
* always return 0 if the item cannot be externally discharged.
|
2013-04-13 16:35:13 +02:00
|
|
|
*
|
2013-07-27 00:16:21 +02:00
|
|
|
* @param itemStack ItemStack to be discharged.
|
|
|
|
* @param energy Maximum amount of energy to be removed from the item.
|
|
|
|
* @param doDischarge If false, the discharge will only be simulated.
|
|
|
|
* @return Amount of energy that was removed from the item.
|
2013-04-13 16:35:13 +02:00
|
|
|
*/
|
2013-07-27 00:16:21 +02:00
|
|
|
public float discharge(ItemStack itemStack, float energy, boolean doDischarge);
|
2013-04-13 16:35:13 +02:00
|
|
|
|
|
|
|
/**
|
2013-07-27 00:16:21 +02:00
|
|
|
* Get the amount of energy currently stored in the item.
|
2013-04-13 16:35:13 +02:00
|
|
|
*/
|
2013-07-27 00:16:21 +02:00
|
|
|
public float getElectricityStored(ItemStack theItem);
|
2013-04-13 16:35:13 +02:00
|
|
|
|
|
|
|
/**
|
2013-07-27 00:16:21 +02:00
|
|
|
* Get the max amount of energy that can be stored in the item.
|
|
|
|
*/
|
|
|
|
public float getMaxElectricityStored(ItemStack theItem);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the amount of energy in the ItemStack.
|
2013-04-13 16:35:13 +02:00
|
|
|
*
|
2013-07-27 00:16:21 +02:00
|
|
|
* @param itemStack - the ItemStack.
|
|
|
|
* @param joules - Amount of electrical energy.
|
|
|
|
*/
|
|
|
|
public void setElectricity(ItemStack itemStack, float joules);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the energy request this ItemStack demands.
|
|
|
|
*/
|
|
|
|
public float getTransfer(ItemStack itemStack);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return The voltage in which this item runs on.
|
2013-04-13 16:35:13 +02:00
|
|
|
*/
|
2013-07-27 00:16:21 +02:00
|
|
|
public float getVoltage(ItemStack itemStack);
|
2013-04-13 16:35:13 +02:00
|
|
|
}
|