{
storer.setEnergy(storer.getEnergy() + EnergizedItemManager.discharge(storer.inventory[slotID], storer.getMaxEnergy() - storer.getEnergy()));
}
else if(MekanismUtils.useIC2() && storer.inventory[slotID].getItem() instanceof IElectricItem)
{
IElectricItem item = (IElectricItem)storer.inventory[slotID].getItem();
if(item.canProvideEnergy(storer.inventory[slotID]))
{
double gain = ElectricItem.manager.discharge(storer.inventory[slotID], (int)((storer.getMaxEnergy() - storer.getEnergy())*Mekanism.TO_IC2), 4, true, true, false)*Mekanism.FROM_IC2;
storer.setEnergy(storer.getEnergy() + gain);
}
}
else if(MekanismUtils.useRF() && storer.inventory[slotID].getItem() instanceof IEnergyContainerItem)
{
ItemStack itemStack = storer.inventory[slotID];
IEnergyContainerItem item = (IEnergyContainerItem)storer.inventory[slotID].getItem();
int itemEnergy = (int)Math.round(Math.min(Math.sqrt(item.getMaxEnergyStored(itemStack)), item.getEnergyStored(itemStack)));
int toTransfer = (int)Math.round(Math.min(itemEnergy, ((storer.getMaxEnergy() - storer.getEnergy())*Mekanism.TO_TE)));
storer.setEnergy(storer.getEnergy() + (item.extractEnergy(itemStack, toTransfer, false)*Mekanism.FROM_TE));
}
else if(storer.inventory[slotID].getItem() == Items.redstone && storer.getEnergy()+Mekanism.ENERGY_PER_REDSTONE <= storer.getMaxEnergy())
{
storer.setEnergy(storer.getEnergy() + Mekanism.ENERGY_PER_REDSTONE);
storer.inventory[slotID].stackSize--;