Applied-Energistics-2-tiler.../items/tools/powered/powersink/ThermalExpansion.java
AlgorithmX2 9a64980443 Build Script Update.
FMP Fixes
Optional Interfaces for BC
Optional Interfaces for IC2
Removed UE Api on Items
Proxied Effect for C-CQuartz
2014-01-28 11:29:17 -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.EU, getMaxEnergyStored( is ) );
}
}