level

package
v0.0.0-...-ca992e9 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChunkW = 16
	ChunkH = 256
	ChunkL = 16

	SliceC = 16
	SliceH = ChunkH / SliceC

	SliceS = ChunkW * ChunkL * SliceH

	BitsPerBlock = 14
	MaxPaletteID = (1 << BitsPerBlock) - 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block interface {
	X() int
	Y() int
	Z() int

	Chunk() Chunk
	Level() Level

	GetBlockType() int
	SetBlockType(value int)
}

type Chunk

type Chunk interface {
	buff.BufferPush

	ChunkX() int
	ChunkZ() int

	Slices() []Slice

	Level() Level

	// supports values y:[0:15]
	GetSlice(y int) Slice

	// supports values x:[0:15] y:[0:255] z: [0:15]
	GetBlock(x, y, z int) Block

	HeightMapNbtCompound() *tags.NbtCompound
}

type Level

type Level interface {
	base.Named
	base.Unique

	Chunks() []Chunk

	GetChunk(x, z int) Chunk

	GetChunkIfLoaded(x, z int) Chunk

	GetBlock(x, y, z int) Block
}

type Slice

type Slice interface {
	buff.BufferPush

	Index() int

	Chunk() Chunk
	Level() Level

	// supports values x:[0:15] y:[0:15] z: [0:15]
	GetBlock(x, y, z int) Block
}

Jump to

Keyboard shortcuts

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