-
-
Notifications
You must be signed in to change notification settings - Fork 375
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 Item Comparison Issues #3419
Fix Item Comparison Issues #3419
Conversation
Some of these changes may cause major issues. More extensive testing may be needed (other than the test script)
Okay, so the latest commit tries to fix more comparison issues by changing the way ItemTypes are compared. I think this way of comparing should work well. I wrote a somewhat extensive test to make sure there aren't any issues, but it's always possible that there could be some. |
Interesting stuff! Infact this started happening after updating to 2.5, the issue was not there in 2.4 |
@APickledWalrus I suggest posting a built jar in this conversation, as most Skript users don't know how to compile and it would help with the testing. Does this pull essentially fix |
I just tried the last nightly build (74fd002) and nope, the issue is still there...
this piece of code counts also renamed diamonds, and removes them from player's inventory... as usual, it used to work before 2.5 came out |
You will need to try the latest build of this PR. You can try downloading it here: https://github.com/SkriptLang/Skript/suites/1272558230/artifacts/19615437 If that doesn’t work, let me know and I can upload a jar here |
I meant to reply to this earlier... whoops. In the case you give, if I use the |
This. Is. Finally. Fixed. Thank you! Merge this damn fix 😆 |
This isn't probably realted to your build but maybe you know what is causing this error in the console, it happens sometimes: |
Also, is this fix included in the last release? The official skript 2.5 |
It is not. However, the Skript jar I linked above is Skript 2.5 + this fix. |
You can open a separate issue report for this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as this all works, and doesn't cause issue, it looks good to me 👍
Description
This PR fixes an issue with item meta comparisons. Essentially, we were checking "our" values for nullness / emptyness but not "their" values. This resulted in the following comparison issue:
"null" and "Diamond" are definitely not the same. Instead, the following scenario now results in a
SAME_MATERIAL
quality result.This actually used to work right before 2.5 alpha 2. At that point in time, we were just checking "their" values which essentially caused this issue but in reverse.
It also fixes issues with skull comparisons and default aliases.
This PR needs more testing before being merged. Input from others is also appreciated.
Target Minecraft Versions: Any
Requirements: Any
Related Issues: #3405 (maybe others too)