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

Allow checking nbt type alongside the key #223

Merged
merged 1 commit into from
May 6, 2023
Merged

Conversation

SoSeDiK
Copy link
Contributor

@SoSeDiK SoSeDiK commented May 6, 2023

No description provided.

@what-the-diff
Copy link

what-the-diff bot commented May 6, 2023

PR Summary

  • Add hasTag method for key validation
    Added a new method hasTag(String key) to NBTCompound that checks if a specific key exists.
  • Deprecate the old method
    The old method is now deprecated in favor of the new one.
  • Improve NBTType check
    Implemented a default method to handle hasTag with NBTType that checks if a key exists and if it is of the correct type. This removes the need to implement the function twice in each class that uses ReadableNBT while maintaining compatibility and preventing code duplication.

@tr7zw tr7zw merged commit 662c0bb into tr7zw:master May 6, 2023
@SoSeDiK SoSeDiK deleted the tagcheck branch September 4, 2023 11:08
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.

2 participants