mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-21 12:03:29 -08:00
I bet this will break shit somewhere (#11292)
This commit is contained in:
parent
8d734d70cd
commit
425b154e3b
2 changed files with 13 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue