Fix fluid naquadah generator not consuming fuel

This commit is contained in:
Blood-Asp 2016-12-27 12:14:40 +01:00
parent 0c56122e35
commit 94cdcfe33c
2 changed files with 7 additions and 1 deletions

View file

@ -191,7 +191,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
} else {
int tFuelValue = getFuelValue(mFluid), tConsumed = consumedFluidPerOperation(mFluid);
if (tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) {
long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
if (tFluidAmountToUse > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) {
tProducedEU = tFluidAmountToUse * tFuelValue;
mFluid.amount -= tFluidAmountToUse * tConsumed;

View file

@ -2,6 +2,7 @@ package gregtech.common.tileentities.generators;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@ -43,6 +44,11 @@ public class GT_MetaTileEntity_FluidNaquadahReactor
public int getEfficiency() {
return mEfficiency;
}
@Override
public long maxEUStore() {
return Math.max(getEUVar(), GT_Values.V[mTier] * 120 + getMinimumStoredEU());
}
public void onConfigLoad() {
this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "FluidNaquadah.efficiency.tier." + this.mTier, 100);