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

feat(nbt): update number parsing for 1.21.5 #1167

Open
wants to merge 2 commits into
base: main/4
Choose a base branch
from

Conversation

kennytv
Copy link
Contributor

@kennytv kennytv commented Feb 27, 2025

Adds support for:

  • completely random underscores within the numbers 💩,
  • hexadecimal and binary numbers,
  • the new signed/unsigned suffix.

This makes -0xabsL or 2____2_____________________________________________________________________________________________________________________________________________________________________________________________________2 valid numbers. In more cases, it may be more lenient than vanilla where it would error, but it should accept what needs to be accepted. I opted to change the existing code with Java number parsing instead of implementing a full blown grammar around scientific notation like Minecraft does 🐥

Does not include changes for number array mixing ([L; 1l, 2i, 3b, 4]) or the escape changes, though I might try to do the first later in a separate PR

@kennytv kennytv force-pushed the feature/snbt-1.21.5 branch from 375a135 to 4186ee1 Compare February 27, 2025 20:58
@kezz kezz added this to the 4.20.0 milestone Feb 27, 2025
@zml2008 zml2008 removed this from the 4.20.0 milestone Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants