Skip to content

Fix Quantum Compressor not running without item in input#20

Merged
Exaxxion merged 1 commit intomasterfrom
QC-fix
Oct 23, 2021
Merged

Fix Quantum Compressor not running without item in input#20
Exaxxion merged 1 commit intomasterfrom
QC-fix

Conversation

@ALongStringOfNumbers
Copy link
Copy Markdown
Member

Fixes the Quantum Compressor not running without an item in the input slot, even when a catalyst was present and the compressor was at the correct amount of input items to make a singularity.

This was occurring because recipe was being initialized to null, and was only being updated in the !input.isEmpty() if statement, meaning that if there was not anything in the input, the recipe would continue to be null and therefore not progress the output.

This PR changes the order of the update loop slightly, first finding the materialStack if the input was not empty, and then finding the recipe and proceeding on with the update loop. This was done to prevent an infinite failure loop, as if the recipe was simply changed to getRecipe(), it would still return null for 1 tick, as it was called before the materialStack was initialized. This lead to the infinite failure loop due to the materialStack being cleared on invalid recipe.

Now, the materialStack is updated first, meaning that recipe will never be null for 1 tick for valid inputs, and also the recipe finding itself is moved out into the main update loop, to prevent null recipe failures later on if the input was empty.

Closes #19

Copy link
Copy Markdown

@Exaxxion Exaxxion left a comment

Choose a reason for hiding this comment

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

qc_pr20.mp4

Looks like it fixes the issue to me.

@Exaxxion Exaxxion merged commit 7a1f8c3 into master Oct 23, 2021
@Exaxxion Exaxxion deleted the QC-fix branch October 23, 2021 22:25
NotMyWing pushed a commit that referenced this pull request Jun 3, 2023
Co-authored-by: DStrand1 <DStrand1@users.noreply.github.com>
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.

Quantum Compressor only processes recipe if there is an item in the input slot

2 participants