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

[Suggestion] Pretty NBT #142

Open
ShaneBeee opened this issue Oct 23, 2021 · 5 comments
Open

[Suggestion] Pretty NBT #142

ShaneBeee opened this issue Oct 23, 2021 · 5 comments

Comments

@ShaneBeee
Copy link

ShaneBeee commented Oct 23, 2021

I wanted to suggest the addition of pretty NBT printing.
This is basically what Minecraft uses when you run the /data command, and its prints the colourful NBT strings

Here is an example showing printing an NBT compound, pretty printing a compound, and pretty printing a compound with a split (split creates new lines, with a string option for how it spaces):

If it helps at all, I will include my class I use in my plugin for this:
https://github.com/ShaneBeee/SkBee/blob/master/src/main/java/com/shanebeestudios/skbee/api/reflection/ChatReflection.java
(pardon my messy code)
Just a heads up also, Minecraft changed the way it worked in 1.17 with a new "tag visitor" system, hence the 2 sets of reflection for 1.16 and 1.17
Hope this helps

@tr7zw
Copy link
Owner

tr7zw commented Oct 25, 2021

That is a good idea. Will add this in the next update.

@tr7zw
Copy link
Owner

tr7zw commented Jun 7, 2022

Uhhhhhh I need more time to do this one, especially in regards to older versions(down to 1.7.10). So it won't be in the next release.

@ShaneBeee
Copy link
Author

That's totally fine. Just a heads up, MC introduced this in MC 1.13, so I would assume you could skip it for lower versions, or just print a string.

@tr7zw
Copy link
Owner

tr7zw commented Jun 7, 2022

The "simplest" way probably is to implement my own formatter. Then it bypasses the issue of older versions in general.

@SuSeu1414
Copy link

I was looking for it. Would be a great feature

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

No branches or pull requests

3 participants