define

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 1 Imported by: 6

Documentation

Index

Constants

View Source
const (
	DimensionIDOverworld = iota
	DimensionIDNether
	DimensionIDEnd
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockState

type BlockState struct {
	Name       string         `nbt:"name"`
	Properties map[string]any `nbt:"states"`
	Version    int32          `nbt:"version"`
}

BlockState holds a combination of a name and properties, together with a version.

type ChunkPos

type ChunkPos [2]int32

ChunkPos holds the position of a chunk. The type is provided as a utility struct for keeping track of a chunk's position. Chunks do not themselves keep track of that. Chunk positions are different from block positions in the way that increasing the X/Z by one means increasing the absolute value on the X/Z axis in terms of blocks by 16.

func (ChunkPos) String

func (p ChunkPos) String() string

String implements fmt.Stringer and returns (x, z).

func (ChunkPos) X

func (p ChunkPos) X() int32

X returns the X coordinate of the chunk position.

func (ChunkPos) Z

func (p ChunkPos) Z() int32

Z returns the Z coordinate of the chunk position.

type Dimension

type Dimension int32

Dimension is a dimension of a World. It influences a variety of properties of a World such as the building range, the sky colour and the behaviour of liquid blocks.

func (Dimension) Height

func (d Dimension) Height() int

Height returns the height of this dimension. For example, the height of overworld is 384 due to "384 = 319 - (-64) + 1", and 319 is the max Y that overworld could build, and -64 is the min Y that overworld could build.

func (Dimension) Range

func (d Dimension) Range() Range

Range returns the lowest and highest valid Y coordinates of a block in the Dimension.

func (Dimension) String

func (d Dimension) String() string

String ..

type HashWithPosY

type HashWithPosY struct {
	Hash uint64
	PosY int8
}

HashWithPosY ..

func (HashWithPosY) String

func (h HashWithPosY) String() string

type NetEaseBlock

type NetEaseBlock struct {
	Name           string         `nbt:"name"`
	NameHash       int64          `nbt:"name_hash"`
	BlockRuntimeID int32          `nbt:"network_id"`
	States         map[string]any `nbt:"states"`
	Val            int16          `nbt:"val"`
	Version        int32          `nbt:"version"`
}

NetEaseBlock is the represents of a block in NetEase

type Range

type Range [2]int

Range represents the height range of a Dimension in blocks. The first value of the Range holds the minimum Y value, the second value holds the maximum Y value.

func (Range) Height

func (r Range) Height() int

Height returns the total height of the Range, the difference between Max and Min.

func (Range) Max

func (r Range) Max() int

Max returns the maximum Y value of a Range. It is equivalent to Range[1].

func (Range) Min

func (r Range) Min() int

Min returns the minimum Y value of a Range. It is equivalent to Range[0].

type SubChunkPos

type SubChunkPos [3]int32

SubChunkPos holds the position of a sub-chunk. The type is provided as a utility struct for keeping track of a sub-chunk's position. Sub-chunks do not themselves keep track of that. Sub-chunk positions are different from block positions in the way that increasing the X/Y/Z by one means increasing the absolute value on the X/Y/Z axis in terms of blocks by 16.

func (SubChunkPos) String

func (p SubChunkPos) String() string

String implements fmt.Stringer and returns (x, y, z).

func (SubChunkPos) X

func (p SubChunkPos) X() int32

X returns the X coordinate of the sub-chunk position.

func (SubChunkPos) Y

func (p SubChunkPos) Y() int32

Y returns the Y coordinate of the sub-chunk position.

func (SubChunkPos) Z

func (p SubChunkPos) Z() int32

Z returns the Z coordinate of the sub-chunk position.

Jump to

Keyboard shortcuts

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