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 issue with GTTransferUtils#insertItem #1661

Merged
merged 1 commit into from
Apr 3, 2023
Merged

Conversation

TechLord22
Copy link
Member

@TechLord22 TechLord22 commented Mar 30, 2023

What

GTTransferUtils#insertItem used ItemHandlerHelper.canItemStacksStackRelaxed previously. This method would condense items of the same metadata if they did not have sub-types. This behavior is undesirable in our use-case, as according to the javadoc it is intended for when players pick up items, and may cause issues with specific items from other mods. It also had measurably worse performance according to a received Spark Report.

Switching to ItemHandlerHelper.canItemStacksStack resolves this.

Outcome

Fixes an issue with GTTransferUtils#insertItem.

@TechLord22 TechLord22 added the type: refactor Suggestion to refactor a section of code label Mar 30, 2023
Copy link
Contributor

@LAGIdiot LAGIdiot left a comment

Choose a reason for hiding this comment

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

Implementation looks reasonable. Ingame test was not performed.

@TechLord22 TechLord22 merged commit c51e99d into master Apr 3, 2023
@TechLord22 TechLord22 deleted the tc-insertitem-fix branch April 3, 2023 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: refactor Suggestion to refactor a section of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants