From 35c83c7ab58a5e0634debcbcaacf710cb2cc5918 Mon Sep 17 00:00:00 2001 From: Kotmatross <110309314+kotmatross28729@users.noreply.github.com> Date: Sun, 17 Nov 2024 17:17:38 +0300 Subject: [PATCH] Summary (required) --- .../java/enviromine/core/EM_Settings.java | 14 ++-- .../enviromine/handlers/EM_StatusManager.java | 72 +++++++++---------- 2 files changed, 42 insertions(+), 44 deletions(-) diff --git a/src/main/java/enviromine/core/EM_Settings.java b/src/main/java/enviromine/core/EM_Settings.java index 2539436..d6b5767 100644 --- a/src/main/java/enviromine/core/EM_Settings.java +++ b/src/main/java/enviromine/core/EM_Settings.java @@ -141,14 +141,12 @@ public class EM_Settings public static float RTGFurnaceHeatConstant = 100; public static float WoodBurningGenHeatDivisor = 16; public static float DieselGenHeatConstant = 50; - public static float ICEHeatConstant = 100; //TODO - public static float CyclotronHeatConstant = 150; //TODO - public static float GeothermalGenHeatDivisor = 10; //TODO - public static float RBMKRodHeatDivisor = 5; //TODO - public static float RBMKRodHeatHardCap = 1500; //TODO - - - public static float ArcFurnaceHeatConstant; //TODO + public static float ICEHeatConstant = 100; + public static float CyclotronHeatConstant = 150; + public static float GeothermalGenHeatDivisor = 10; + public static float RBMKRodHeatDivisor = 5; + public static float RBMKRodHeatHardCap = 1500; + public static float ArcFurnaceHeatConstant = 200; public static float FlareStackHeatConstant; //TODO public static float CokerHeatDivisor; //TODO public static float TurbofanHeatConstant; //TODO diff --git a/src/main/java/enviromine/handlers/EM_StatusManager.java b/src/main/java/enviromine/handlers/EM_StatusManager.java index cdb5f4a..f7b63be 100644 --- a/src/main/java/enviromine/handlers/EM_StatusManager.java +++ b/src/main/java/enviromine/handlers/EM_StatusManager.java @@ -473,15 +473,16 @@ else if(tileentity instanceof TileEntityNukeFurnace nukeFurnace) { } } else if(tileentity instanceof TileEntityRtgFurnace rtgFurnace) { + //this shouldn't really be a constant, but I don't give a fuck if(rtgFurnace.isProcessing()){ - //Works in space - ❔ + //Works in space - ✅ blockAndItemTempInfluence += getTempFalloff((EM_Settings.RTGFurnaceHeatConstant*2), dist, cubeRadius, EM_Settings.blockTempDropoffPower); } } else if(tileentity instanceof TileEntityMachineWoodBurner woodBurner) { int powerGen = 0; try { - Field powerGenz = TileEntityMachineWoodBurner.class.getDeclaredField("powerGen"); + Field powerGenz = TileEntityMachineWoodBurner.class.getDeclaredField("powerGen"); //куадусешщт powerGenz.setAccessible(true); powerGen = (int) powerGenz.get(woodBurner); } catch (NoSuchFieldException | IllegalAccessException ignored) {} @@ -494,53 +495,52 @@ else if(tileentity instanceof TileEntityMachineWoodBurner woodBurner) { } else if(tileentity instanceof TileEntityMachineDiesel diesel) { if(diesel.tank.getFill() > 0 && TileEntityMachineDiesel.getHEFromFuel(diesel.tank.getTankType()) > 0L) { - //Works in space - ❔ + //Works in space - ❌ blockAndItemTempInfluence += getTempFalloff((EM_Settings.DieselGenHeatConstant*2), dist, cubeRadius, EM_Settings.blockTempDropoffPower); } } else if(tileentity instanceof TileEntityMachineCombustionEngine combustionEngine) { - if(combustionEngine.isOn) { - //Works in space - ❔ + if(combustionEngine.wasOn) { + //Works in space - ❌ blockAndItemTempInfluence += getTempFalloff((EM_Settings.ICEHeatConstant*2), dist, cubeRadius, EM_Settings.blockTempDropoffPower); } } else if(tileentity instanceof TileEntityMachineCyclotron cyclotron) { if(cyclotron.progress > 0) { - //Works in space - ❔ + //Works in space - ✅ blockAndItemTempInfluence += getTempFalloff((EM_Settings.CyclotronHeatConstant*2), dist, cubeRadius, EM_Settings.blockTempDropoffPower); } } else if(tileentity instanceof TileEntityMachineHephaestus hephaestus) { //GeoThermal - if(hephaestus.bufferedHeat > 0) { - //Works in space - ❔ - blockAndItemTempInfluence += getTempFalloff((hephaestus.bufferedHeat / EM_Settings.GeothermalGenHeatDivisor), dist, cubeRadius, EM_Settings.blockTempDropoffPower); + if(hephaestus.getTotalHeat() > 0) { + //Max - 10_000/10 = 493℃ (expected 500) ✅ + //Works in space - ✅ + blockAndItemTempInfluence += getTempFalloff((hephaestus.getTotalHeat() / EM_Settings.GeothermalGenHeatDivisor), dist, cubeRadius, EM_Settings.blockTempDropoffPower); } } else if(tileentity instanceof TileEntityRBMKBase rbmkBase) { if(rbmkBase.heat > 0) { - //Works in space - ❔ + //Works in space - ✅ blockAndItemTempInfluence += getTempFalloff(Math.min(((float)rbmkBase.heat / EM_Settings.RBMKRodHeatDivisor), EM_Settings.RBMKRodHeatHardCap*2), dist, cubeRadius, EM_Settings.blockTempDropoffPower); } } else if(tileentity instanceof TileEntityMachineArcFurnaceLarge arcFurnaceLarge) { - //TODO - //progress = - //isProgressing = - //Concl. = CONST - //Works in space - ❔ -// LogManager.getLogger().fatal("TileEntityMachineArcFurnaceLarge : "); -// LogManager.getLogger().fatal("progress : " + arcFurnaceLarge.progress); -// LogManager.getLogger().fatal("isProgressing : " + arcFurnaceLarge.isProgressing); + if(arcFurnaceLarge.isProgressing) { + //Works in space - ✅ + blockAndItemTempInfluence += getTempFalloff((EM_Settings.ArcFurnaceHeatConstant*2), dist, cubeRadius, EM_Settings.blockTempDropoffPower); + } } else if(tileentity instanceof TileEntityMachineGasFlare gasFlare) { - //TODO - //isOn = - //doesBurn = - //Concl. = CONST - //Works in space - ❔ -// LogManager.getLogger().fatal("TileEntityMachineGasFlare : "); -// LogManager.getLogger().fatal("isOn : " + gasFlare.isOn); -// LogManager.getLogger().fatal("doesBurn : " + gasFlare.doesBurn); + int powerGen = 0; + try { + Field output = TileEntityMachineGasFlare.class.getDeclaredField("output"); + output.setAccessible(true); + powerGen = (int) output.get(gasFlare); + } catch (NoSuchFieldException | IllegalAccessException ignored) {} + if(gasFlare.doesBurn && powerGen > 0) { + //Works in space - ❔ + blockAndItemTempInfluence += getTempFalloff((EM_Settings.FlareStackHeatConstant*2), dist, cubeRadius, EM_Settings.blockTempDropoffPower); + } } else if(tileentity instanceof TileEntityMachineCoker coker) { //TODO @@ -549,18 +549,18 @@ else if(tileentity instanceof TileEntityMachineCoker coker) { //heat = //Concl. = NOT CONST - heat //Works in space - ❔ -// LogManager.getLogger().fatal("TileEntityMachineCoker : "); -// LogManager.getLogger().fatal("wasOn : " + coker.wasOn); -// LogManager.getLogger().fatal("progress : " + coker.progress); -// LogManager.getLogger().fatal("heat : " + coker.heat); + LogManager.getLogger().fatal("TileEntityMachineCoker : "); + LogManager.getLogger().fatal("wasOn : " + coker.wasOn); + LogManager.getLogger().fatal("progress : " + coker.progress); + LogManager.getLogger().fatal("heat : " + coker.heat); } else if(tileentity instanceof TileEntityMachineTurbofan turbofan) { //TODO //wasOn = //Concl. = CONST //Works in space - ❔ -// LogManager.getLogger().fatal("TileEntityMachineTurbofan : "); -// LogManager.getLogger().fatal("wasOn : " + turbofan.wasOn); + LogManager.getLogger().fatal("TileEntityMachineTurbofan : "); + LogManager.getLogger().fatal("wasOn : " + turbofan.wasOn); } else if(tileentity instanceof TileEntityMachineTurbineGas turbineGas) { //TODO @@ -569,10 +569,10 @@ else if(tileentity instanceof TileEntityMachineTurbineGas turbineGas) { //temp = //Concl. = NOT CONST - temp //Works in space - ❔ -// LogManager.getLogger().fatal("TileEntityMachineTurbineGas : "); -// LogManager.getLogger().fatal("state : " + turbineGas.state); -// LogManager.getLogger().fatal("active (cust) : " + (turbineGas.state == 1)); -// LogManager.getLogger().fatal("temp : " + turbineGas.temp); + LogManager.getLogger().fatal("TileEntityMachineTurbineGas : "); + LogManager.getLogger().fatal("state : " + turbineGas.state); + LogManager.getLogger().fatal("active (cust) : " + (turbineGas.state == 1)); + LogManager.getLogger().fatal("temp : " + turbineGas.temp); } } }