Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

File loading problems #43

Open
tryashtar opened this issue Jun 22, 2022 · 0 comments
Open

File loading problems #43

tryashtar opened this issue Jun 22, 2022 · 0 comments
Assignees

Comments

@tryashtar
Copy link
Owner

So, it seems like there are two different "empty" region files that are failing to load:

  • Actually empty, zero-length files
  • Files with a full header, but all 8196 bytes are zeros. And then some trailing data sometimes

Both of these should load as empty regions. But... isn't it a bad idea to treat every empty file as a region file? Yes, that's why we should do this:

  • Guess the file format from the file extension: .nbt is probably binary NBT... .mca is probably a region file
  • Try to load it that way, with some special logic. Empty files just get new'd up. Region files bypass the one-chunk check
  • If that fails (or unrecognized extension), try all other ways of loading the file, without the special logic

Also we need to fail faster at file type verification; exceptions are cringe. You already did both of these things in Quick Music so just do that again

@tryashtar tryashtar self-assigned this Jun 22, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant