diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 9c02c7c7ae..a70a11ec4d 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -70,8 +70,8 @@ public class Block extends UnlockableContent implements Senseable{ public boolean separateItemCapacity = false; /** maximum items this block can carry (usually, this is per-type of item) */ public int itemCapacity = 10; - /** maximum total liquids this block can carry if hasLiquids = true */ - public float liquidCapacity = 10f; + /** maximum total liquids this block can carry if hasLiquids = true. Default value is 10, scales with max liquid consumption in ConsumeLiquid */ + public float liquidCapacity = -1f; /** higher numbers increase liquid output speed; TODO remove and replace with better liquids system */ public float liquidPressure = 1f; /** If true, this block outputs to its facing direction, when applicable. @@ -1327,6 +1327,17 @@ public class Block extends UnlockableContent implements Senseable{ lightClipSize = Math.max(lightClipSize, size * 30f * 2f); } + // some blocks dont have hasLiquids but have liquid consumers/liquid capacity + if(liquidCapacity < 0){ + float consumeAmount = 1f; + for(var cons : consumeBuilder){ + if(cons instanceof ConsumeLiquid liq){ + consumeAmount = Math.max(consumeAmount, liq.amount * 60f); + } + } + liquidCapacity = Mathf.round(10f * consumeAmount); + } + if(emitLight){ lightClipSize = Math.max(lightClipSize, lightRadius * 2f); } diff --git a/core/src/mindustry/world/blocks/production/Drill.java b/core/src/mindustry/world/blocks/production/Drill.java index c2b3d62fbf..8c00eb03c4 100644 --- a/core/src/mindustry/world/blocks/production/Drill.java +++ b/core/src/mindustry/world/blocks/production/Drill.java @@ -79,7 +79,6 @@ public class Drill extends Block{ solid = true; group = BlockGroup.drills; hasLiquids = true; - liquidCapacity = 5f; hasItems = true; ambientSound = Sounds.loopDrill; ambientSoundVolume = 0.019f;