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(wool): use platform-specific ColorUtils for wool matching #1364

Merged

Conversation

TTtie
Copy link
Contributor

@TTtie TTtie commented Jul 10, 2024

On 1.21 servers, CraftItemStack#getData() returns unsubclassed MaterialData for wool item stacks, hence we cannot check for instanceof Wool there. This patch changes the appropriate code to a manual comparison, enabling pickup and proximity tracking to work regardless of whether the material data is correctly subclassed.

On 1.21 servers, CraftItemStack#getData() returns unsubclassed MaterialData for wool item stacks, hence we cannot check for `instanceof Wool` there. This patch changes the appropriate code to a manual comparison, enabling pickup and proximity tracking to work regardless of whether the material data is correctly subclassed.

Signed-off-by: TTtie <[email protected]>
@TTtie TTtie changed the title fix(MonumentWoolFactory): manually check for item type and color fix(wool): use platform-specific ColorUtils for wool matching Jul 10, 2024
@TTtie TTtie requested a review from cswhite2000 July 10, 2024 17:38
Copy link
Member

@cswhite2000 cswhite2000 left a comment

Choose a reason for hiding this comment

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

nothing major, few minor things

@TTtie TTtie requested a review from Pablete1234 July 10, 2024 21:02
Per PGMDev#1364 (comment) explicit access modifiers are preferred and there is no good reason to ban possible subclasses of WoolModule from accessing the material matcher

Signed-off-by: TTtie <[email protected]>
@cswhite2000 cswhite2000 merged commit 63e8ff9 into PGMDev:fix-wool-matching Jul 11, 2024
2 checks passed
Pablete1234 pushed a commit that referenced this pull request Jul 20, 2024
Pablete1234 pushed a commit that referenced this pull request Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants