Skip to content

Commit

Permalink
Allow fluid type configuration for ConsumeCoolant
Browse files Browse the repository at this point in the history
  • Loading branch information
MEEPofFaith committed Jul 25, 2023
1 parent 93daa7a commit 1317407
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/mindustry/world/consumers/ConsumeCoolant.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
/** A ConsumeLiquidFilter that consumes specific coolant, selected based on stats. */
public class ConsumeCoolant extends ConsumeLiquidFilter{
public float maxTemp = 0.5f, maxFlammability = 0.1f;
public boolean allowLiquid = true, allowGas = false;

public ConsumeCoolant(float amount){
this.filter = liquid -> liquid.coolant && !liquid.gas && liquid.temperature <= maxTemp && liquid.flammability < maxFlammability;
this.filter = liquid -> liquid.coolant && (allowLiquid && !liquid.gas || allowGas && liquid.gas) && liquid.temperature <= maxTemp && liquid.flammability < maxFlammability;
this.amount = amount;
}

Expand Down

0 comments on commit 1317407

Please sign in to comment.