From d79f5cf9d04e8ec0d23e00cafff94844d6b7af31 Mon Sep 17 00:00:00 2001 From: cm0x4D Date: Thu, 14 Jul 2016 16:40:44 +0200 Subject: [PATCH] Fixes #387 --- src/main/java/mods/eln/Eln.java | 2 ++ .../java/mods/eln/sixnode/lampsocket/LampSocketProcess.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/mods/eln/Eln.java b/src/main/java/mods/eln/Eln.java index b14ccc9f7..294984627 100644 --- a/src/main/java/mods/eln/Eln.java +++ b/src/main/java/mods/eln/Eln.java @@ -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); @@ -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; diff --git a/src/main/java/mods/eln/sixnode/lampsocket/LampSocketProcess.java b/src/main/java/mods/eln/sixnode/lampsocket/LampSocketProcess.java index f91bdc95b..f6c05522b 100644 --- a/src/main/java/mods/eln/sixnode/lampsocket/LampSocketProcess.java +++ b/src/main/java/mods/eln/sixnode/lampsocket/LampSocketProcess.java @@ -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;