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

Fiix getArray mistake in CondIsTagged, add runtime error for bad namespace keys in ExprTag #7474

Open
wants to merge 1 commit into
base: dev/patch
Choose a base branch
from

Conversation

sovdeeth
Copy link
Member

@sovdeeth sovdeeth commented Jan 18, 2025

Description

changes getArray to getAnd in CondIsTagged to fix #7471
adds runtime error to catch invalid tags in ExprTag


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

@sovdeeth sovdeeth added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Jan 18, 2025
@sovdeeth sovdeeth changed the base branch from master to dev/patch January 18, 2025 19:15
@Efnilite Efnilite added the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Jan 19, 2025
Copy link
Contributor

@ShaneBeee ShaneBeee left a comment

Choose a reason for hiding this comment

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

Just a couple small things.

Comment on lines +103 to +107
error("Invalid tag key: '" + name + "'. Tags may only contain a-z, 0-9, _, ., or - characters.");
continue;
}
if (key == null)
if (key == null) {
error("Invalid tag key: '" + name + "'. Tags may only contain a-z, 0-9, _, ., or - characters.");
Copy link
Contributor

Choose a reason for hiding this comment

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

NamespacedKeys can also contain /

register a custom item tag named "or_list_tag_2" using spruce log

loop 10 times:
assert oak log is tagged as custom tag "or_list_tag_1" or custom tag "or_list_tag_2"
Copy link
Contributor

@ShaneBeee ShaneBeee Jan 20, 2025

Choose a reason for hiding this comment

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

I believe the original issue was relating to tag A or B?!?!
Maybe add another check:
assert oak log is tagged as custom tag "or_list_tag_1" or "or_list_tag_2"

I could be totally wrong here.

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. 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.

CondIsTagged uses getArray instead of getAll
4 participants