/* * This file is part of Applied Energistics 2. * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. * * Applied Energistics 2 is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Applied Energistics 2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Applied Energistics 2. If not, see . */ package appeng.items.tools.powered.powersink; /* @Interface(iface = "universalelectricity.core.item.IItemElectric", modid = "IC2") public class UniversalElectricity extends ThermalExpansion implements IItemElectric { * * public UniversalElectricity(Class c, String subName) { super( c, subName ); } * * @Override public float recharge(ItemStack is, float energy, boolean * doRecharge) { return (float) (energy - injectExternalPower( PowerUnits.KJ, * is, energy, !doRecharge )); } * * @Override public float discharge(ItemStack is, float energy, boolean * doDischarge) { return 0; } * * @Override public float getElectricityStored(ItemStack is) { return (int) * PowerUnits.AE.convertTo( PowerUnits.KJ, getAECurrentPower( is ) ); } * * @Override public float getMaxElectricityStored(ItemStack is) { return (int) * PowerUnits.AE.convertTo( PowerUnits.KJ, getAEMaxPower( is ) ); } * * @Override public void setElectricity(ItemStack is, float joules) { double * currentPower = getAECurrentPower( is ); double targetPower = * PowerUnits.KJ.convertTo( PowerUnits.AE, joules ); if ( targetPower > * currentPower ) injectAEPower( is, targetPower - currentPower ); else * extractAEPower( is, currentPower - targetPower ); } * * @Override public float getTransfer(ItemStack is) { return (float) * PowerUnits.AE.convertTo( PowerUnits.KJ, getAEMaxPower( is ) - * getAECurrentPower( is ) ); } * * @Override public float getVoltage(ItemStack itemStack) { return 120; } } */