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
So, it seems like there are two different "empty" region files that are failing to load:
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:
.nbt
is probably binary NBT....mca
is probably a region filenew
'd up. Region files bypass the one-chunk checkAlso 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