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 TargetHitEvent#getSignalStrength() post-hard-fork #11897

Merged

Conversation

Doc94
Copy link
Contributor

@Doc94 Doc94 commented Jan 4, 2025

Reported in discord TargetHitEvent#getSignalStrength() return just 20 or 8 based in the projectile this behaviour is a side-effect caused by hard-fork where pre-hard-fork the value used is called "i" (ref: https://github.com/PaperMC/Paper/blob/master/patches/server/0441-Add-TargetHitEvent.patch and broken in e9680a5#diff-3a492050417244fc5b90189b40134f0124f010ffb92b94158329562b71014f59R16) but now is called redstoneStrength and i is just used for another thing.


Download the paperclip jar for this pull request: paper-11897.zip

@Doc94 Doc94 requested a review from a team as a code owner January 4, 2025 03:02
@lynxplay lynxplay added the build-pr-jar Enables a workflow to build Paperclip jars on the pull request. label Jan 4, 2025
Copy link
Member

@Machine-Maker Machine-Maker left a comment

Choose a reason for hiding this comment

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

You also need to update the usage of i inside the last hunk in that file, the call to awardTargetHitCriteria.

@Doc94 Doc94 requested a review from Machine-Maker January 4, 2025 03:50
@kennytv kennytv added type: bug Something doesn't work as it was intended to. priority: high This issue is either a gamebreaking bug or crash and needs to be addressed soon. labels Jan 4, 2025
@Machine-Maker Machine-Maker added for: future Issue scheduled for resolution at some point in the future. and removed for: future Issue scheduled for resolution at some point in the future. labels Jan 4, 2025
@lynxplay lynxplay merged commit 33a590b into PaperMC:main Jan 4, 2025
9 checks passed
@Doc94 Doc94 deleted the fix/target-hit-event-bad-signal-strenght branch January 4, 2025 20:35
@Machine-Maker
Copy link
Member

It's not so much "typos" as it's just hunks that applied successfully but the names of local variables changed which changed some functionality. The diff between this and pre-hard fork is way too littered with all the other renaming/decompiler changes. Our tooling also changes the local variable names to much nicer names (in some cases) which renames all the other local variables as well. So it's just a matter of identifying those cases. We did several pass throughs of the whole diff right after, and found a bunch.

lynxplay pushed a commit to notTamion/paper that referenced this pull request Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-pr-jar Enables a workflow to build Paperclip jars on the pull request. priority: high This issue is either a gamebreaking bug or crash and needs to be addressed soon. type: bug Something doesn't work as it was intended to.
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

4 participants