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 some item comparison issues #2834

Merged
merged 3 commits into from
Mar 1, 2020
Merged

Conversation

bensku
Copy link
Member

@bensku bensku commented Feb 29, 2020

Description

I fixed a few quirks with item comparisons that caused scripts to remove wrong items in some cases.

  • Missing item meta values (e.g. names) of items in inventories are no longer ignored
    • Previously, removing a named item would also remove unnamed items
    • Instead, removing an unnamed item will (as intended) remove those that do have names
  • Items in inventories that fail meta checks are no longer promoted as successful matches
    • Promotion used to be done for items without any meta
    • Lack of meta in items is significant, so this was not safe
    • Promotion is still done for aliases that do not have any tags

Please test this PR for regressions before approving. There might be nasty regressions that I didn't think of.


Target Minecraft Versions: any, but won't solve comparison issues specific to 1.12 and older versions
Requirements: none
Related Issues: #2714

@bensku bensku added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Feb 29, 2020
Copy link
Member

@TheBentoBox TheBentoBox left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link
Contributor

@ShaneBeee ShaneBeee left a comment

Choose a reason for hiding this comment

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

I tested with a handful of different items, named and unnamed.
This PR appears to successfully resolve the issues as stated.

Looks good to me 👍

@ShaneBeee ShaneBeee merged commit 4563dcd into master Mar 1, 2020
@Nicofisi Nicofisi deleted the feature/item-compare-fixes branch March 1, 2020 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants