Applied-Energistics-2-tiler.../items/tools/powered/powersink/ThermalExpansion.java
2014-02-08 19:34:52 -06:00

40 lines
1.1 KiB
Java

package appeng.items.tools.powered.powersink;
import net.minecraft.item.ItemStack;
import appeng.api.config.PowerUnits;
import cofh.api.energy.IEnergyContainerItem;
import cpw.mods.fml.common.Optional.Interface;
@Interface(iface = "cofh.api.energy.IEnergyContainerItem", modid = "ThermalExpansion")
public class ThermalExpansion extends IC2 implements IEnergyContainerItem
{
public ThermalExpansion(Class c, String subname) {
super( c, subname );
}
@Override
public int receiveEnergy(ItemStack is, int maxReceive, boolean simulate)
{
return maxReceive - (int) injectExternalPower( PowerUnits.RF, is, maxReceive, simulate );
}
@Override
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate)
{
return 0;
}
@Override
public int getEnergyStored(ItemStack is)
{
return (int) PowerUnits.AE.convertTo( PowerUnits.RF, getAECurrentPower( is ) );
}
@Override
public int getMaxEnergyStored(ItemStack is)
{
return (int) PowerUnits.AE.convertTo( PowerUnits.RF, getAEMaxPower( is ) );
}
}