Skip to content

Commit

Permalink
Fix liquid input into the flowrate void getting capped
Browse files Browse the repository at this point in the history
  • Loading branch information
MEEPofFaith committed Mar 16, 2024
1 parent 2327171 commit e3644f2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/extrasandredux/world/blocks/storage/FlowrateVoid.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
import extrasandredux.util.*;
import mindustry.core.*;
import mindustry.entities.*;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*;
import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.blocks.payloads.*;
import mindustry.world.meta.*;
import mindustry.world.modules.*;

import static mindustry.Vars.*;

Expand Down Expand Up @@ -118,6 +120,13 @@ public class FlowrateVoidBuild extends PayloadBlockBuild<Payload>{
public PayloadSeq payloads = new PayloadSeq();
public ObjectMap<Block, PayloadInputData> payloadData = new ObjectMap<>();

@Override
public Building create(Block block, Team team){
super.create(block, team);
if(block.hasLiquids) liquids = new EmptyLiquidModule();
return self();
}

@Override
public void draw(){
Draw.rect(region, x, y);
Expand Down Expand Up @@ -341,4 +350,11 @@ public void eachLiquid(Cons2<Liquid, Float> cons){
}
}
}

public static class EmptyLiquidModule extends LiquidModule{
@Override
public float get(Liquid liquid){
return 0f; //Return 0 so that liquid flow rate is always the same,
}
}
}

0 comments on commit e3644f2

Please sign in to comment.