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 for exact event values in the event value expression #5579

Merged
merged 5 commits into from
May 20, 2023

Conversation

TheLimeGlass
Copy link
Collaborator

@TheLimeGlass TheLimeGlass commented Apr 4, 2023

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

public static <T> ClassInfo<T> getExactClassInfo(final @Nullable Class<T> c) {

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

@TheLimeGlass 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 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
Copy link
Member

@AyhamAl-Ali AyhamAl-Ali left a comment

Choose a reason for hiding this comment

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

Well done ⚡

@TheLimeGlass TheLimeGlass requested a review from Pikachu920 April 28, 2023 09:46
Copy link
Member

@APickledWalrus APickledWalrus left a 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.

@TheLimeGlass TheLimeGlass merged commit 8726c08 into master May 20, 2023
@TheLimeGlass TheLimeGlass deleted the fix/exact-event-values branch May 20, 2023 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.7 Targeting a 2.7.X version release 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.

4 participants