New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Power Requested trigger #4299

Merged
merged 5 commits into from Nov 9, 2018

Conversation

Projects
None yet
2 participants
@therealfarfetchd
Contributor

therealfarfetchd commented Nov 9, 2018

Trigger turns on when requested power is more than 1 MJ.

@AlexIIL

This comment has been minimized.

Member

AlexIIL commented Nov 9, 2018

Erm, can you revert your cleanup comment and just check to see if the requested is greater than 0 for any of them? (As some things request less than 1 MJ I think?)

Although you could probably extract the implementation of PipeFlowPower.Section.getPowerRequested() to the main class and provide the this.side as null for the trigger, then check and cast the IPipeHolder.getFlow() into PipeFlowPower rather than the TilePipeHolder itself.

(Generally we've found replacing lambdas with normal loops to be quite a decent optimisation)

@therealfarfetchd

This comment has been minimized.

Contributor

therealfarfetchd commented Nov 9, 2018

The cleanup commit fixes a bug, but I guess I can convert that into a normal loop.

@AlexIIL

This comment has been minimized.

Member

AlexIIL commented Nov 9, 2018

Oh it did? What was the bug? (As I didn't look very hard, sorry :| )

@therealfarfetchd

This comment has been minimized.

Contributor

therealfarfetchd commented Nov 9, 2018

At first, it cycled through the facings one by one and when it found a capability, it took it. Now if the only power consumer was on that side, getPowerRequested() would return 0 since it filters out the requested power of the side you got the capability from. That is not an issue anymore though

AlexIIL and others added some commits Nov 9, 2018

Update common/buildcraft/transport/statements/TriggerPowerRequested.java
Co-Authored-By: therealfarfetchd <git@marco-rebhan.de>
@AlexIIL

This comment has been minimized.

Member

AlexIIL commented Nov 9, 2018

build failed with import order violation

Oh well obviously I can't merge this yet then :p

@AlexIIL AlexIIL merged commit f6b19a8 into BuildCraft:8.0.x Nov 9, 2018

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@AlexIIL

This comment has been minimized.

Member

AlexIIL commented Nov 9, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment