-
-
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 for exact event values in the event value expression #5579
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TheLimeGlass
added
bug
An issue that needs to be fixed. Alternatively, a PR fixing an issue.
2.7
Targeting a 2.7.X version release
labels
Apr 4, 2023
TheLimeGlass
changed the title
Allow support for exact event values in the event value expression
Fix for exact event values in the event value expression
Apr 4, 2023
AyhamAl-Ali
approved these changes
Apr 23, 2023
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.
Well done ⚡
APickledWalrus
requested changes
May 9, 2023
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.
Looks pretty good overall. Just a few minor things.
src/main/java/ch/njol/skript/expressions/base/PropertyExpression.java
Outdated
Show resolved
Hide resolved
UnderscoreTud
approved these changes
May 17, 2023
APickledWalrus
approved these changes
May 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
With the new addition of extension classes to Entity in the form of EventValueExpression, we're seeing issues where Skript was preferring the entity over the egg in the provided related issue. "What came first? The egg or the entity?" Well Skript thought it was the Entity, but it was actually wrong ;)
So this pull request adds a boolean argument to the constructor of EventValueExpression to strictly tell the event value getter lookup to not check for subclasses and also to not convert.
A similar issue was present with ClassInfos back when Njol was making Skript, which is why we have so many methods in the Classes class
Skript/src/main/java/ch/njol/skript/registrations/Classes.java
Line 291 in 1f20b98
Classes like Egg that extend Entity should not be grabbing Entity from the event. They should be only grabbing Egg and nothing else. If Egg doesn't exist, it should state that Egg doesn't exist in that event.
Target Minecraft Versions: any
Requirements: none
Related Issues: #5539