Skip to content

Ensure listType is set to compound tag when wrapping tags #3794

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

Closed
wants to merge 4 commits into from

Conversation

JulianVennen
Copy link
Contributor

@JulianVennen JulianVennen commented Feb 25, 2025

Fixes #3793

@md-5
Copy link
Member

md-5 commented Feb 25, 2025

Can you add a unit test please?

@JulianVennen
Copy link
Contributor Author

Done. Do you know if wrapping elements in compound tags works on every Minecraft version bungee supports or should we add code to make sure that only happens if there are actually different types in the list?

@md-5
Copy link
Member

md-5 commented Feb 26, 2025

Would probably be better to do if only different types to simplify the nbt, but I'm not sure

- Only wrap items in a compound tag if different types are used
- Support mixed lists with bytes, ints and longs
@JulianVennen
Copy link
Contributor Author

Done. I also fixed mixed lists that start with a byte, int or long which previously were always their native arrays even if they included other types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TagUtil.fromJson produces invalid lists with wrong type
2 participants