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 ExprPlain always getting the base material from ItemTypes #6391

Merged
merged 4 commits into from
Feb 4, 2024

Conversation

sovdeeth
Copy link
Member

@sovdeeth sovdeeth commented Feb 2, 2024

Description

Calls ItemType#getRandom() to ensure the item is a accurate representation of the alias (e.g. any sword) before getting the material.


Target Minecraft Versions: any
Requirements: none
Related Issues: #5994

@sovdeeth sovdeeth added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. 2.8 Targeting a 2.8.X version release labels Feb 2, 2024
@sovdeeth sovdeeth added the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Feb 2, 2024
@Pikachu920
Copy link
Member

can we add a regression test please?

@sovdeeth
Copy link
Member Author

sovdeeth commented Feb 3, 2024

can we add a regression test please?

I didn't know how to do one that didn't have an inherently random chance of failing. Any advice?

@Pikachu920
Copy link
Member

Pikachu920 commented Feb 4, 2024

can we add a regression test please?

I didn't know how to do one that didn't have an inherently random chance of failing. Any advice?

i think you could use easymock to ensure getRandom gets called on the itemtype

@sovdeeth sovdeeth merged commit 884641c into SkriptLang:dev/patch Feb 4, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.8 Targeting a 2.8.X version release bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants