Skip to content

Commit

Permalink
Fixes #387
Browse files Browse the repository at this point in the history
  • Loading branch information
cm0x4D committed Jul 14, 2016
1 parent f70c116 commit d79f5cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/mods/eln/Eln.java
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ public void preInit(FMLPreInitializationEvent event) {
economicLampLife = config.get("lamp", "economicLifeInHours", 64.0).getDouble(64.0) * 3600;
carbonLampLife = config.get("lamp", "carbonLifeInHours", 6.0).getDouble(6.0) * 3600;
ledLampLife = config.get("lamp", "ledLifeInHours", 512.0).getDouble(512.0) * 3600;
ledLampInfiniteLife = config.get("lamp", "infiniteLedLife", false).getBoolean();

fuelGeneratorTankCapacity = config.get("fuelGenerator",
"tankCapacityInSecondsAtNominalPower", 20 * 60).getDouble(20 * 60);
Expand Down Expand Up @@ -3112,6 +3113,7 @@ void registerRegulatorItem(int id) {
double economicLampLife;
double carbonLampLife;
double ledLampLife;
public static boolean ledLampInfiniteLife = false;

void registerLampItem(int id) {
int subId, completId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ public void process(double time) {
overFactor = 1.5;

updateLifeTimeout += deltaT;
if (updateLifeTimeout > updateLifeTimeoutMax) {
if (updateLifeTimeout > updateLifeTimeoutMax &&
!(lampDescriptor.type == Type.LED && Eln.ledLampInfiniteLife)) {
// Utils.println("aging");
updateLifeTimeout -= updateLifeTimeoutMax;
double lifeLost = overFactor * updateLifeTimeoutMax / lampDescriptor.nominalLife;
Expand Down

0 comments on commit d79f5cf

Please sign in to comment.