chunk

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidChunk       = errors.New("invalid chunk")
	ErrUnKnownCompression = errors.New("unknown compression")
)
View Source
var (
	ErrNBTUUID   = errors.New("错误的 uuid")
	ErrNotStruct = errors.New("不是 struct")
	ErrNotSlice  = errors.New("不是 slice")
	ErrNotInt32  = errors.New("不是 int32")
	ErrPos       = errors.New("错误的坐标")
)
View Source
var ErrFormt = errors.New("错误的格式")
View Source
var ErrNotMap = errors.New("not map")
View Source
var ErrOutRange = errors.New("超过数组范围")

Functions

func BlockPos2Mca

func BlockPos2Mca(x, z int) string

func WriteChunk

func WriteChunk(d Region[[]Entities]) error

Types

type Chunk

type Chunk[K any] struct {
	X    int
	Z    int
	Data K
}

type Entities

type Entities struct {
	UUID string            `json:",omitempty"`
	POS  []int             `json:",omitempty"`
	PATH map[string]string `json:",omitempty"`
	Root string            `json:",omitempty"`
}

type ErrNotExistSector

type ErrNotExistSector struct {
	X        int
	Z        int
	FilePath string
}

func (ErrNotExistSector) Error

func (e ErrNotExistSector) Error() string

type Region

type Region[K any] struct {
	FilePath string
	Chunk    []Chunk[K] `json:",omitempty"`
}

func PaseMca

func PaseMca[K any](f io.ReadWriteSeeker, filePath string) (Region[[]Entities], error)

func (*Region[K]) RemoveNull

func (r *Region[K]) RemoveNull()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL