NBT RawMessage fully support

This commit is contained in:
Tnze
2021-07-05 00:58:41 +08:00
parent 43588a8894
commit d7091db5b3
13 changed files with 196 additions and 94 deletions

View File

@ -454,7 +454,7 @@ func (n nbtField) WriteTo(w io.Writer) (int64, error) {
func (n nbtField) ReadFrom(r io.Reader) (int64, error) {
// LimitReader is used to count reader length
lr := &io.LimitedReader{R: r, N: math.MaxInt64}
err := nbt.NewDecoder(lr).Decode(n.V)
_, err := nbt.NewDecoder(lr).Decode(n.V)
if err != nil && errors.Is(err, nbt.ErrEND) {
err = nil
}