GregTechCEu / GregTech

GregTech CE 1.12 fork continuing progression and development
GNU Lesser General Public License v3.0
253 stars 176 forks source link

Critical flaw in generator code #2246

Closed M-W-K closed 11 months ago

M-W-K commented 11 months ago

GregTech CEu Version

v2.8.0

Modpack Used

None

Addons Installed

Gregicality Multiblocks v1.2.6

Environment

Singleplayer

New Worlds

Yes

Cross-Mod Interaction

No

Expected Behavior

Generators should consume as much fuel as they need to generate their power, and stop or produce less power if they don't have enough

Actual Behavior

If enough fuel is present in the buffer for the base, unparallelized recipe to run when the recipe completes/starts, the generator will activate with full output no matter how much fuel was actually consumed.

Steps to Reproduce

Additional Information

If you are using One Probe, you can see that the second turbine completes every 2 ticks. Because of the creative tank's settings, the turbine's internal steam buffer is filled with exactly 640 steam right before the turbine does its next recipe checks.

Going to the actual recipe check logic, which is unchanged for generators, we discover that the check has zero idea of how many parallelizations the recipe is undergoing, and as such only checks if the internal tank has what it needs for the base recipe. Thus, the check sees 640 steam in the tank and signals the all clear, despite far more steam actually being required.

M-W-K commented 11 months ago

Loading into 2.8.2, I can make some further clarifications: