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

Support for top tag being other than compound #56

Open
maxsupermanhd opened this issue Nov 14, 2023 · 2 comments
Open

Support for top tag being other than compound #56

maxsupermanhd opened this issue Nov 14, 2023 · 2 comments
Labels
feature New feature or request

Comments

@maxsupermanhd
Copy link

Getting an error "Top tag should be a compound". Would be nice if it supported arrays and list too. Other types are probably readable just with hex dump I guess...

@misode
Copy link
Owner

misode commented Nov 14, 2023

The top tag not being a compound is usually a good early indication that the file is corrupted. Maybe it would make sense to show a prompt asking whether to load the file anyways?

@maxsupermanhd
Copy link
Author

Not really good early indication that the file is corrupted, while client or server usually produces/uses nbt files that have root compound it does not mean that all files are root compound.

I think there are other ways of detecting if file is corrupted (probably parse it completely first and then decide if it junk or not) aside from magic root compound, besides even with root compound magic there is a good possibility that internal tags within compound are broken (I seen a lot of those being produced by go-mc library for example).

I would say a prompt with 4 choices is a good way to go: Close, View xxd dump, Open this file, Open and don't ask again.

Even if file is corrupted, what's the worst that can happen?

@misode misode added the feature New feature or request label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants