region

package
v1.14.5-0...-43f7235 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func In

func In(cx, cy int) (int, int)

In calculate chunk's coordinates relative to region

Types

type Region

type Region struct {
	// contains filtered or unexported fields
}

Region contain 32*32 chunks in one .mca file

func Create

func Create(name string) (r *Region, err error)

Create open .mca file with os.O_CREATE|os. O_EXCL, and init the region

func Open

func Open(name string) (r *Region, err error)

Open open a .mca file and read the head. Close the Region after used.

func (*Region) Close

func (r *Region) Close() error

Close close the region file

func (*Region) ExistSector

func (r *Region) ExistSector(x, y int) bool

ExistSector return if a sector is exist

func (*Region) ReadSector

func (r *Region) ReadSector(x, y int) (data []byte, err error)

ReadSector find and read the Chunk data from region

func (*Region) WriteSector

func (r *Region) WriteSector(x, y int, data []byte) error

WriteSector write Chunk data into region file

Jump to

Keyboard shortcuts

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