diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 8e733dab1f..0f479096b0 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -363,6 +363,16 @@ public class Block extends BlockStorage{ return sum; } + public float percentSolid(int x, int y){ + Tile tile = world.tile(x, y); + if(tile == null) return 0; + float sum = 0; + for(Tile other : tile.getLinkedTilesAs(this, tempTiles)){ + sum += !other.floor.isLiquid ? 1f : 0f; + } + return sum / size / size; + } + @Override public String localizedName(){ return localizedName; diff --git a/core/src/io/anuke/mindustry/world/blocks/production/SolidPump.java b/core/src/io/anuke/mindustry/world/blocks/production/SolidPump.java index efe34f5dfb..15a0e4f88d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/SolidPump.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/SolidPump.java @@ -42,7 +42,7 @@ public class SolidPump extends Pump{ @Override public void drawPlace(int x, int y, int rotation, boolean valid){ if(attribute != null){ - drawPlaceText(Core.bundle.formatFloat("bar.efficiency", (sumAttribute(attribute, x, y) + 1f) * 100, 1), x, y, valid); + drawPlaceText(Core.bundle.formatFloat("bar.efficiency", (sumAttribute(attribute, x, y) + 1f) * 100 * percentSolid(x, y), 1), x, y, valid); } } @@ -51,7 +51,7 @@ public class SolidPump extends Pump{ super.setBars(); bars.add("efficiency", entity -> new Bar(() -> Core.bundle.formatFloat("bar.efficiency", - ((((SolidPumpEntity)entity).boost + 1f) * ((SolidPumpEntity)entity).warmup) * 100, 1), + ((((SolidPumpEntity)entity).boost + 1f) * ((SolidPumpEntity)entity).warmup) * 100 * percentSolid(entity.tile.x, entity.tile.y), 1), () -> Pal.ammo, () -> ((SolidPumpEntity)entity).warmup)); }