Skip to content
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
Merged

Conversation

2xsaiko
Copy link
Contributor

@2xsaiko 2xsaiko commented Nov 9, 2018

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

@AlexIIL
Copy link
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)

@2xsaiko
Copy link
Contributor Author

2xsaiko commented Nov 9, 2018

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

@AlexIIL
Copy link
Member

AlexIIL commented Nov 9, 2018

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

@2xsaiko
Copy link
Contributor Author

2xsaiko 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 2 commits November 9, 2018 20:02
@AlexIIL
Copy link
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
@AlexIIL
Copy link
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants