Re-add single-use batteries

How did this get removed? ><
This commit is contained in:
Timeslice42 2016-11-04 05:32:56 -07:00 committed by Blood-Asp
parent 58206f909e
commit 7df5add5a9

View file

@ -445,6 +445,12 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) {
if (mMetaTileEntity.mInventory[i] != null && getStoredEU() < getEUCapacity()) {
dischargeItem(mMetaTileEntity.mInventory[i]);
if(ic2.api.info.Info.itemEnergy.getEnergyValue(mMetaTileEntity.mInventory[i])>0){
if((getStoredEU() + ic2.api.info.Info.itemEnergy.getEnergyValue(mMetaTileEntity.mInventory[i]))<getEUCapacity()){
increaseStoredEnergyUnits((long)ic2.api.info.Info.itemEnergy.getEnergyValue(mMetaTileEntity.mInventory[i]),false);
mMetaTileEntity.mInventory[i].stackSize--;
}
}
if (mMetaTileEntity.mInventory[i].stackSize <= 0)
mMetaTileEntity.mInventory[i] = null;
mInventoryChanged = true;
@ -1871,4 +1877,4 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
mMetaTileEntity.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider);
}
}
}