Implement multiplayer persistence and vanilla lighting

This commit is contained in:
Master290 2026-07-21 09:21:44 +03:00
parent 8f7cacf9d9
commit cae06eb97e
47 changed files with 3784 additions and 465 deletions

View file

@ -10,12 +10,16 @@ import (
// default compression for Anvil .mca chunk records (compression type 2).
// zlibDeflate compresses src into a new byte slice.
func zlibDeflate(src []byte) []byte {
func zlibDeflate(src []byte) ([]byte, error) {
var buf bytes.Buffer
w := zlib.NewWriter(&buf)
_, _ = w.Write(src)
_ = w.Close()
return buf.Bytes()
if _, err := w.Write(src); err != nil {
return nil, err
}
if err := w.Close(); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
// zlibInflate decompresses src (a zlib stream). It returns an error if src is