func NewChest() Chest {
	m := new(sync.RWMutex)
	v := make(map[ContainerViewer]struct{}, 1)
	return Chest{
		inventory: inventory.New(27, func(slot int, item item.Stack) {
			m.RLock()
			defer m.RUnlock()
			for viewer := range v {
				viewer.ViewSlotChange(slot, item)
			}
		}),
		viewerMu: m,
		viewers:  v,
	}
}
NewChest creates a new initialised chest. The inventory is properly initialised.
package block
import (
	"fmt"
	"github.com/df-mc/dragonfly/server/block/action"
	"github.com/df-mc/dragonfly/server/block/cube"
	"github.com/df-mc/dragonfly/server/internal/nbtconv"
	"github.com/df-mc/dragonfly/server/item"
	"github.com/df-mc/dragonfly/server/item/inventory"
	"github.com/df-mc/dragonfly/server/world"
	"github.com/df-mc/dragonfly/server/world/sound"
	"github.com/go-gl/mathgl/mgl64"
	"strings"
	"sync"
)
type Chest struct {
	chest
	transparent
	bass
	Facing cube.Direction
	CustomName string
	inventory *inventory.Inventory
	viewerMu  *sync.RWMutex
	viewers   map[ContainerViewer]struct{}
}