From e99b9c2ad1eb0bd11054ebeee2b25d788f3cdb8a Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 11 Feb 2024 09:00:51 -0500 Subject: [PATCH] Fixed #9537 --- core/src/mindustry/game/Schematic.java | 2 +- core/src/mindustry/world/blocks/power/PowerGenerator.java | 4 ++++ core/src/mindustry/world/blocks/power/ThermalGenerator.java | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/game/Schematic.java b/core/src/mindustry/game/Schematic.java index 75ac43ec66..dde5886f60 100644 --- a/core/src/mindustry/game/Schematic.java +++ b/core/src/mindustry/game/Schematic.java @@ -31,7 +31,7 @@ public class Schematic implements Publishable, Comparable{ } public float powerProduction(){ - return tiles.sumf(s -> s.block instanceof PowerGenerator p ? p.powerProduction : 0f); + return tiles.sumf(s -> s.block instanceof PowerGenerator p ? p.getDisplayedPowerProduction() : 0f); } public float powerConsumption(){ diff --git a/core/src/mindustry/world/blocks/power/PowerGenerator.java b/core/src/mindustry/world/blocks/power/PowerGenerator.java index 966c2c48d0..fb77b987a1 100644 --- a/core/src/mindustry/world/blocks/power/PowerGenerator.java +++ b/core/src/mindustry/world/blocks/power/PowerGenerator.java @@ -46,6 +46,10 @@ public class PowerGenerator extends PowerDistributor{ flags = EnumSet.of(BlockFlag.generator); } + public float getDisplayedPowerProduction(){ + return powerProduction; + } + @Override public TextureRegion[] icons(){ return drawer.finalIcons(this); diff --git a/core/src/mindustry/world/blocks/power/ThermalGenerator.java b/core/src/mindustry/world/blocks/power/ThermalGenerator.java index eb2eff6cee..9195205a9f 100644 --- a/core/src/mindustry/world/blocks/power/ThermalGenerator.java +++ b/core/src/mindustry/world/blocks/power/ThermalGenerator.java @@ -26,6 +26,11 @@ public class ThermalGenerator extends PowerGenerator{ noUpdateDisabled = true; } + @Override + public float getDisplayedPowerProduction(){ + return powerProduction / displayEfficiencyScale; + } + @Override public void init(){ if(outputLiquid != null){