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

Given NBT stream does not start with a TAG_Compound #91

Open
ryanjanke opened this issue Oct 17, 2021 · 7 comments
Open

Given NBT stream does not start with a TAG_Compound #91

ryanjanke opened this issue Oct 17, 2021 · 7 comments

Comments

@ryanjanke
Copy link

ryanjanke commented Oct 17, 2021

Has anyone else seen this issue with backup downloaded from a realm?

8188 of 47821 Chunks render @ 244.8 cps Error in CreateChunkAndRenderBlock: Given NBT stream does not start with a TAG_Compound

When I download from a Bedrock Realm running 1.17.34 I see this about 20 times, then there are chunks in the map that show as black. Usually it's ones where there is a lot of player constructed objects at multiple Y levels.

@wraithgar
Copy link

Probably related, I'm seeing odd version 9 subchunks as of 1.17.34 (using the official bedrock server) that have what appears to be an empty runtime/palette byte.

Manually parsing the data it appears to be where the paletteAndFlag usually are, there are two empty bytes followed by a single nbt.

I made a gist trying to show the data I have, compared to a valid subchunk that's at the very next subchunk_index https://gist.github.com/wraithgar/a01b99ee7433a9c8a359069952f2147e

@evilzenscientist
Copy link

evilzenscientist commented Oct 20, 2021

+1 with newest Bedrock - I don't this is specifically realm related, perhaps a change in data structure for all bedrock maps?

@TapeWerm
Copy link

TapeWerm commented Oct 23, 2021

I use bedrock dedicated server and see this. I should poke my world and find what NBT is causing this.
Edit: The chunks have barrels in common, I have not poked my save data which is a bit big to upload to GitHub.

@quaderror
Copy link

+1 for the newest Bedrock, and I'm not using a realm. Ran into this after freshly cloning and compiling with the instructions for linux-x64.

@ryanjanke
Copy link
Author

My own testing seems to corroborate @TapeWerm's observation that all the affected chunks contain barrels.

@TapeWerm
Copy link

TapeWerm commented Nov 1, 2021

I should emphasize it could be a complete coincidence, there are chunks that also have barrels that rendered just fine. Amulet Editor loaded the chunks Papyrus CS failed to, and I haven't read my world's leveldb files.

@TapeWerm
Copy link

TapeWerm commented Nov 7, 2021

Probably related, I'm seeing odd version 9 subchunks as of 1.17.34 (using the official bedrock server) that have what appears to be an empty runtime/palette byte.

Manually parsing the data it appears to be where the paletteAndFlag usually are, there are two empty bytes followed by a single nbt.

I made a gist trying to show the data I have, compared to a valid subchunk that's at the very next subchunk_index https://gist.github.com/wraithgar/a01b99ee7433a9c8a359069952f2147e

If I wrap a if (paletteAndFlag != 0) around

for (int palletId = 0; palletId < localPalette.Size; palletId++)
{
    var (name, val) = GetNbtVal(ms);
    localPalette.Put(palletId, name, val);
}

in https://github.com/papyrus-mc/papyruscs/blob/master/Maploader/World/World.cs the map comes out fine. Heavy emphasis on I am not remotely familiar with the codebase, I would be shocked if that is a proper fix without introducing regressions.

Edit:
Adding a basecase to continue before that for loop also works and seems more efficient, but as always remember that I do not know what I am doing. localPalette.Size is almost the max int value on storage 1 for some version 9 chunks. I suspect the Size is not actually reading an int but a string or some other value.

if (paletteAndFlag == 0)
    continue;
for (int palletId = 0; palletId < localPalette.Size; palletId++)
{
    var (name, val) = GetNbtVal(ms);
    localPalette.Put(palletId, name, val);
}

Edit 2: Might be safer to just return than continue to the next loop iteration given the file reader.

hrmorley34 added a commit to hrmorley34/papyruscs that referenced this issue Nov 18, 2021
hrmorley34 added a commit to hrmorley34/papyruscs that referenced this issue Nov 18, 2021
bennydiamond pushed a commit that referenced this issue Dec 7, 2021
* Fix furnace, lit furnace to use top texture

* Fix issues when bitsPerBlock == 0 (#91)

* Fix y-level ranges

* Update textures to 1.18

* Fix issues with render size

* Various fixes

* Improve candle rendering

* Improve grindstone rendering

* Improve lever rendering

* Improve sign/banner rendering

* Improve repeater/comparator rendering

* Improve string rendering

It looks like in the game it is scaled down more, so this is the best we
can do.

* Improve bell rendering

* Fix lectern rotation

* Fix loom rotation

* Fix some comments

* Fix cocoa beans

* Fix bamboo
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 a pull request may close this issue.

5 participants