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

Parse more UnparsedLiterals, but only if they're actually meaningful #4776

Merged
merged 7 commits into from
Jun 30, 2022

Conversation

TPGamesNL
Copy link
Member

@TPGamesNL TPGamesNL commented Jun 1, 2022

Description

The change made in #4242 made it so that parseSingleExpr (with allowUnparsedLiteral false) would still return a parsed literal if the given type is Object.class.

This is a problem, because if there is a literal conflict (e.g. end crystal is a material and a heal reason) this means it chooses an arbitrary literal. Normally, these value conflicts are solved by returning an UnparsedLiteral which is later parsed by the syntax element into the right type. If it chooses a random value, this is no longer possible (well it technically is if you look at CondCompare#reparseLiteral, but this isn't preferred).

This fix reverts the aforementioned PR, and fixes the issues that PR was fixing differently: current fix allows for more UnparsedLiteral returns, but only if the unparsed text can actually be parsed into a literal.


Target Minecraft Versions: any
Requirements: none
Related Issues:

Related PRs:

@TPGamesNL TPGamesNL added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Jun 1, 2022
@TheLimeGlass TheLimeGlass mentioned this pull request Jun 16, 2022
1 task
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 good to me :)

I'm going to do some additional testing as well (with this & other related fixes)

@TheLimeGlass
Copy link
Contributor

Did a few tests and it avoids the conflict issues people have been reporting.

@TheLimeGlass TheLimeGlass mentioned this pull request Jun 30, 2022
1 task
@TheLimeGlass TheLimeGlass merged commit c6bfd66 into SkriptLang:master Jun 30, 2022
@TheLimeGlass TheLimeGlass added completed The issue has been fully resolved and the change will be in the next Skript update. and removed completed The issue has been fully resolved and the change will be in the next Skript update. labels Jun 30, 2022
@TPGamesNL TPGamesNL deleted the fix/unparsedliterals branch June 30, 2022 06:52
AyhamAl-Ali pushed a commit to AyhamAl-Ali/Skript that referenced this pull request Jul 4, 2022
…kriptLang#4776)

* Parse more UnparsedLiterals, but only if they're actually meaningful

* Fix visual effects not being visible further than 1 block away if optional range was not set.

* Fix server startup issue 1.19 (SkriptLang#4849)
bilektugrul added a commit to bilektugrul/Skript that referenced this pull request Jul 29, 2022
bilektugrul added a commit to bilektugrul/Skript that referenced this pull request Jul 29, 2022
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.

4 participants