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

Expose ItemEntity#target's value in ItemEntityPickupEvent #1009

Merged

Conversation

TelepathicGrunt
Copy link
Contributor

This is breaking for anyone calling the hooks themselves but that should be ok since we are still in beta phase and event is new.

Closes #1003

@TelepathicGrunt TelepathicGrunt added enhancement New (or improvement to existing) feature or request 1.20.6 Targeted at Minecraft 1.20.6 labels May 26, 2024
@TelepathicGrunt TelepathicGrunt self-assigned this May 26, 2024
@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented May 26, 2024

  • Publish PR to GitHub Packages

Last commit published: 0c5f8cde82b3590a68930c5e060669a71ff5d30c.

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 #1009' // https://github.com/neoforged/NeoForge/pull/1009
        url 'https://prmaven.neoforged.net/NeoForge/pr1009'
        content {
            includeModule('net.neoforged', 'testframework')
            includeModule('net.neoforged', 'neoforge')
        }
    }
}

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-pr1009.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr1009
cd NeoForge-pr1009
curl -L https://prmaven.neoforged.net/NeoForge/pr1009/net/neoforged/neoforge/20.6.108-beta-pr-1009-ItemPickupEventTarget/mdk-pr1009.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.

XFactHD
XFactHD previously approved these changes May 26, 2024
Copy link
Member

@Matyrobbrt Matyrobbrt left a comment

Choose a reason for hiding this comment

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

Doc nitpicks

Matyrobbrt
Matyrobbrt previously approved these changes May 28, 2024
@Shadows-of-Fire
Copy link
Contributor

Shadows-of-Fire commented May 28, 2024

Does it make more sense to just patch in a getter method for ItemEntity#target and/or just apply the AT for it? There's already a public setter, so its not like encapsulation is a concern.

If any other item-related events need the target, that approach will require fewer changes

@TelepathicGrunt
Copy link
Contributor Author

@Shadows-of-Fire wha. Why mojang add setter but no getter? Huh. Yeah a getter patched in would be ideal imo.

pupnewfster
pupnewfster previously approved these changes May 29, 2024
@Shadows-of-Fire Shadows-of-Fire enabled auto-merge (squash) May 29, 2024 01:48
@Shadows-of-Fire Shadows-of-Fire merged commit afca8c6 into neoforged:1.20.x May 29, 2024
3 checks passed
@TelepathicGrunt TelepathicGrunt deleted the ItemPickupEventTarget branch June 12, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.20.6 Targeted at Minecraft 1.20.6 enhancement New (or improvement to existing) feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make ItemEntity#target accessible from ItemEntityPickupEvent
5 participants