Fix Gas Generator not accepting gas when empty

It could only do so when the tank was empty and the burn ticks where 0.

However, burnticks would never be at 0 the way it was calculated.
This commit is contained in:
DrParadox7 committed 2022-11-11 13:35:29 +01:00
1 parent ee331b8dea
commit d421edc04d
1 file changed
+7 -4
@@ -56,15 +56,17 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
{
Gas gasType = null;
if(fuelTank.getGas() != null)
if(fuelTank.getStored() > 0 && fuelTank.getGas() != null)
{
gasType = fuelTank.getGas().getGas();
}
else if(inventory[0] != null && inventory[0].getItem() instanceof IGasItem)
{
if(((IGasItem)inventory[0].getItem()).getGas(inventory[0]) != null)
GasStack gas = ((IGasItem)inventory[0].getItem()).getGas(inventory[0]);
if(gas != null && FuelHandler.getFuel(gas.getGas()) != null)
{
gasType = ((IGasItem)inventory[0].getItem()).getGas(inventory[0]).getGas();
gasType = gas.getGas();
}
}
@@ -132,6 +134,7 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
maxBurnTicks = 0;
generationRate = 0;
output = general.FROM_H2*2;
fuelTank.setGas(null);
}
public int getToUse()
@@ -188,7 +191,7 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
@Override
public boolean canOperate()
{
return (fuelTank.getStored() > 0 || burnTicks > 0) && MekanismUtils.canFunction(this);
return fuelTank.getStored() > 0 && MekanismUtils.canFunction(this);
}
/**