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

Fix NPE when non-BlockEntity calls AbstractFurnaceBlockEntity#craftRecipe #339

Merged
merged 6 commits into from
Sep 5, 2023

Conversation

Virtuoel
Copy link
Contributor

If smelting is performed from a non-in-world "furnace" (e.g. portable furnace from PortableTables), the ThreadLocal used for remainder item overflow dropping may be null, or may correspond to the location of a different in-world furnace.

The getting of the BE from the ThreadLocal has been moved so it happens during the actual dropping of the items, to prevent accessing the ThreadLocal when items don't need dropping.

Since the position is not needed if there are no overflowing remainder items, the recipe output mixin will check if there is no BE performing the smelting and if there would be a remainder that cannot fit, and in that situation, prevents the output from accepting more items.

Draft because not sure if the additional API method is desirable or not.

Copy link
Contributor

@EnnuiL EnnuiL left a comment

Choose a reason for hiding this comment

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

address oro's review and i'll consider it approved

@EnnuiL EnnuiL added library: item Related to the item library. t: refactor This proposes a refactor. t: new api This adds a new API. s: waiting for test This pull request is waiting to be tested, the PR cannot be put in FCP until it has been tested. labels Aug 25, 2023
@OroArmor OroArmor requested a review from EnnuiL August 28, 2023 04:40
@Virtuoel Virtuoel marked this pull request as ready for review August 30, 2023 07:57
@EnnuiL EnnuiL changed the title Fix NPE when non-BlockEntity calls AbstractFurnaceBlockEntity#craftRecipe Fix NPE when non-BlockEntity calls AbstractFurnaceBlockEntity#craftRecipe Sep 2, 2023
@EnnuiL
Copy link
Contributor

EnnuiL commented Sep 2, 2023

This PR has entered a Final Comment Period of 5 days on August 31st, with 3 days remaining now

@EnnuiL EnnuiL merged commit 8c62723 into QuiltMC:1.20 Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
final-comment-period library: item Related to the item library. s: waiting for test This pull request is waiting to be tested, the PR cannot be put in FCP until it has been tested. t: new api This adds a new API. t: refactor This proposes a refactor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants