X Tutup
Skip to content

Fix MJ-RF conversion calculation#51

Merged
AlexIIL merged 1 commit intoBuildCraft:8.0.x-1.12.2from
jchung01:fix/mj-to-rf
Oct 30, 2025
Merged

Fix MJ-RF conversion calculation#51
AlexIIL merged 1 commit intoBuildCraft:8.0.x-1.12.2from
jchung01:fix/mj-to-rf

Conversation

@jchung01
Copy link
Contributor

The RF->MJ->RF conversion in receiveEnergy() was using the max receiveable MJ maxReceiveMJ, the amount before passing the power to the IMjReceiver, to calculate resultant RF. It should use the post-recieved, actual accepted amount of power by the MJ receiver acceptedMj. This caused a discrepancy in the amount of excessMJ (calculated based on post-receive), and the amount it was subtracted from (based on pre-receive) to calculate exactAcceptedMj.

This caused crashes like this. This crash can be recreated with minimal mods in the below scenario:
2025-10-29_18 44 44
An Extra Utilities (XU2) Energy Transfer node (extracting from an XU2 Creative Energy Source) with cable connected to an obsidian pipe, and throwing any item into the obsidian pipe. I've verified in a minimal instance (Buildcraft + Extra Utiltiies) that this setup no longer crashes with the changes.

Should fix BuildCraft/BuildCraft#4730, it's a similar crash.

@AlexIIL
Copy link
Member

AlexIIL commented Oct 30, 2025

Thanks!

@AlexIIL AlexIIL merged commit 9d26ef0 into BuildCraft:8.0.x-1.12.2 Oct 30, 2025
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.

Crash with automatic RF/MJ conversion

2 participants

X Tutup