Skip to content

Fix LCE constantly ticking when it has fuel but no lubricant - #5356

Open
DilithiumThoride wants to merge 6 commits into
1.20.1from
dt/combustion-retrynt
Open

DilithiumThoride wants to merge 6 commits into
1.20.1from
dt/combustion-retrynt

Conversation

@DilithiumThoride

Copy link
Copy Markdown
Contributor

What

While testing #5355 I accidentally stumbled upon another issue:
If a Large Combustion Engine contains Fuel but no Lubricant, it will try to start a recipe every tick, fail every tick, and send a sync packet every tick of the failed recipe start.

There is no reason for an LCE to keep trying to run when it can't, so this PR makes a fueled LCE stop ticking and sit fully idle until Notified it should try again. The LCE reports to the user that it is idle because it has no lubricant.

Implementation Details

Custom minimal internal RecipeLogic whose sole purpose is to check if the last recipe attempt failed due to no lubricant, and if it did to unsubscribe the ticker.

AI Usage

  • [ X ] No AI driven tools were used for this pull request.

Outcome

Unlubricated LCEs stop draining ticks and packets and only wake up when notified they can actually try to turn on again.

How Was This Tested

Creative test world

@DilithiumThoride
DilithiumThoride requested a review from a team as a code owner August 27, 2026 23:41
@DilithiumThoride DilithiumThoride added type: bugfix General bug fixes 1.20.1 Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. labels Aug 27, 2026
@github-actions github-actions Bot added the Tests: Passed Game Tests have passed on this PR label Aug 27, 2026

@jurrejelle jurrejelle left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this whole PR could be replaced with

  @Override                                                                                                                                                                                                                                                                                                         
  public boolean isRecipeLogicAvailable() {
      return super.isRecipeLogicAvailable() &&
              RecipeHelper.matchRecipe(this, getLubricantRecipe()).isSuccess();
  }

? Might be cleaner and doesn't add state modified in a recipe modifier which seems a bit wonky
Edit: review assisted by opus which cooked this up

@DilithiumThoride

Copy link
Copy Markdown
Contributor Author

I think this whole PR could be replaced with

  @Override                                                                                                                                                                                                                                                                                                         
  public boolean isRecipeLogicAvailable() {
      return super.isRecipeLogicAvailable() &&
              RecipeHelper.matchRecipe(this, getLubricantRecipe()).isSuccess();
  }

? Might be cleaner and doesn't add state modified in a recipe modifier which seems a bit wonky Edit: review assisted by opus which cooked this up

This does have the desired effect of preventing machine ticks until lubricant is supplied, but it also prevents the UI from updating to show the missing lubricant warning. Fortunately that's fixable.

@DilithiumThoride

Copy link
Copy Markdown
Contributor Author

Oh it also stops the machine from actually turning off when it runs out of lubricant, that's not ideal.

@github-actions github-actions Bot added Tests: Failed Game Tests have failed on this PR and removed Tests: Passed Game Tests have passed on this PR labels Sep 5, 2026
@github-actions github-actions Bot added Tests: Passed Game Tests have passed on this PR and removed Tests: Failed Game Tests have failed on this PR labels Sep 6, 2026

This branch has not been deployed

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

Labels

1.20.1 Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. Tests: Passed Game Tests have passed on this PR type: bugfix General bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants