Sandertv / gophertunnel

General purpose library for Minecraft Bedrock Edition software written in Go
MIT License
419 stars 95 forks source link

Discussion: Allow reading zero (tagEnd) NBT tags #164

Closed TwistedAsylumMC closed 1 year ago

TwistedAsylumMC commented 1 year ago

The vanilla client allows a server to write a 0 byte which indicates an immediate tagEnd, which is not supported by gophertunnel. Since the client allows it and can read the rest of the packet without issues, I believe it should also be implemented in gophertunnel

Sandertv commented 1 year ago

This is, however, invalid NBT, so the question is whether we should allow this or actually explicitly build in support.

Flonja commented 1 year ago

Have it be an option you'll have to enable. Having strict checks is nicer to have, but can be annoying on a gophertunnel client connection.

JustTalDevelops commented 1 year ago

I think it'd be best to add a debug log when invalid NBT is detected, but still allow for it to be decoded anyway. That way we have the best of both worlds; an NBT parser that is completely compatible with vanilla, and logs for invalid NBT, which can aid developers in improving and/or fixing their software.