Skip to content

Fix ComponentItemHandler#extractItem sometimes returning an incorrect result #2137

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

Merged
merged 2 commits into from
Apr 14, 2025

Conversation

pupnewfster
Copy link
Member

If attempting to extract more of an item than is stored from a ComponentItemHandler, it would return the incorrect result if there was less of it stored than the max stack size.

https://discord.com/channels/313125603924639766/1154167065519861831/1361341413152919673

@neoforged-automation neoforged-automation bot added the 1.21.5 Targeted at Minecraft 1.21.5 label Apr 14, 2025
@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Apr 14, 2025

  • Publish PR to GitHub Packages

Last commit published: 28c8455e77b0cc2e55614607f932202ecdd9178f.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #2137' // https://github.com/neoforged/NeoForge/pull/2137
        url 'https://prmaven.neoforged.net/NeoForge/pr2137'
        content {
            includeModule('net.neoforged', 'neoforge')
            includeModule('net.neoforged', 'testframework')
        }
    }
}

MDK installation

In order to setup a MDK using the latest PR version, run the following commands in a terminal.
The script works on both *nix and Windows as long as you have the JDK bin folder on the path.
The script will clone the MDK in a folder named NeoForge-pr2137.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr2137
cd NeoForge-pr2137
curl -L https://prmaven.neoforged.net/NeoForge/pr2137/net/neoforged/neoforge/21.5.41-beta-pr-2137-handler_fix/mdk-pr2137.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip

To test a production environment, you can download the installer from here.

@sciwhiz12 sciwhiz12 added the bug A bug or error label Apr 14, 2025
Copy link
Member

@sciwhiz12 sciwhiz12 left a comment

Choose a reason for hiding this comment

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

Confirmed that the unit test as changed here fails without the PR's fix, and succeeds with the PR's fix implemented.

@pupnewfster pupnewfster merged commit 7d3c106 into neoforged:1.21.x Apr 14, 2025
6 checks passed
@pupnewfster pupnewfster deleted the handler_fix branch April 14, 2025 14:58
@pupnewfster
Copy link
Member Author

@neoforged/bots backport 1.21.1

@neoforged-automation
Copy link
Contributor

Backporting to 1.21.1...

@neoforged-releases
Copy link

🚀 This PR has been released as NeoForge version 21.5.39-beta.

@pupnewfster

This comment has been minimized.

@neoforged-automation
Copy link
Contributor

Created backport PR: #2139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.5 Targeted at Minecraft 1.21.5 bug A bug or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants