Skip to content

Commit

Permalink
[Payloads] Output support (almost working)
Browse files Browse the repository at this point in the history
  • Loading branch information
JojoFR1 committed Dec 26, 2023
1 parent dfcbef5 commit 69d3810
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/src/multicraft/MultiCrafter.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import mindustry.logic.*;
import mindustry.type.*;
import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.blocks.heat.*;
import mindustry.world.blocks.payloads.*;
import mindustry.world.consumers.*;
Expand Down Expand Up @@ -376,6 +377,20 @@ public void dumpOutputs() {
dumpLiquid(fluids[i].liquid, 2f, dir);
}
}

//TODO fix infinite output
if (cur.isOutputPayload()) {
for (PayloadStack output : cur.output.payloads) {
Payload payloadOutput = null;
if (output.item instanceof Block)
payloadOutput = new BuildPayload((Block) output.item, this.team);
else if (output.item instanceof UnitType)
payloadOutput = new UnitPayload(((UnitType)output.item).constructor.get());

if (payloadOutput != null)
movePayload(payloadOutput);
}
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions lib/test/TestParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.junit.jupiter.api.Test;

public class TestParser {
@SuppressWarnings("unused")
@Test
public void input(){
Vars.content = new ContentLoader();
Expand Down

0 comments on commit 69d3810

Please sign in to comment.