world_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: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeyVersion holds a single byte of data with the version of the chunk.
	KeyVersion = ',' // 2c
	// KeyVersionOld was replaced by keyVersion. It is still used by vanilla to check compatibility, but vanilla no
	// longer writes this tag.
	KeyVersionOld = 'v' // 76
	// KeyBlockEntities holds n amount of NBT compound tags appended to each other (not a TAG_List, just appended). The
	// compound tags contain the position of the block entities.
	KeyBlockEntities = '1' // 31
	// KeyEntitiesOld holds n amount of NBT compound tags appended to each other (not a TAG_List, just appended). The
	// compound tags contain the position of the entities.
	KeyEntitiesOld = '2' // 32
	// KeyPendingScheduledTicks holds an NBT structure containing all scheduled
	// ticks that were pending in the chunk.
	KeyPendingScheduledTicks = '3'
	// keyFinalisation contains a single LE int32 that indicates the state of generation of the chunk. If 0, the chunk
	// needs to be ticked. If 1, the chunk needs to be populated and if 2 (which is the state generally found in world
	// saves from vanilla), the chunk is fully finalised.
	KeyFinalisation = '6' // 36
	// key3DData holds 3-dimensional biomes for the entire chunk.
	Key3DData = '+' // 2b
	// key2DData is no longer used in worlds with world height change. It was replaced by key3DData in newer worlds
	// which has 3-dimensional biomes.
	Key2DData = '-' // 2d
	// keyChecksum holds a list of checksums of some sort. It's not clear of what data this checksum is composed or what
	// these checksums are used for.
	KeyChecksums = ';' // 3b

	KeyEntityIdentifiers = "digp"
	KeyEntity            = "actorprefix"

	KeyChunkTimeStamp       = 'T'              // time stamp
	KeyDeltaUpdateTimeStamp = "dutsp"          // delta update time stamp prefix
	KeyDeltaUpdate          = "dup"            // delta update prefix
	KeyBlobHash             = "blobhashprefix" // blob hash prefix
)

Keys on a per-chunk basis. These are prefixed by only the chunk coordinates.

View Source
const (
	KeyAutonomousEntities = "AutonomousEntities"
	KeyOverworld          = "Overworld"
	KeyMobEvents          = "mobevents"
	KeyBiomeData          = "BiomeData"
	KeyScoreboard         = "scoreboard"
	KeyLocalPlayer        = "~local_player"
)

Keys on a per-world basis. These are found only once in a leveldb world save.

View Source
const (
	FinalisationNeedsTicked = iota
	FinalisationNeedsPopulated
	FinalisationGenerated
)
View Source
const ChunkVersion = 41

ChunkVersion is the current version of chunks.

View Source
const (
	KeySubChunkData = '/' // 2f
)

Keys on a per-sub chunk basis. These are prefixed by the chunk coordinates and subchunk ID.

Variables

This section is empty.

Functions

func Index

func Index(dm define.Dimension, position define.ChunkPos) []byte

Index returns a byte buffer holding the written index of the chunk position passed. If the dimension passed is not world.Overworld, the length of the index returned is 12. It is 8 otherwise.

func Sum

func Sum(dm define.Dimension, position define.ChunkPos, p ...byte) []byte

Sum converts Index(dm, position) to its []byte representation and appends p. Note that Sum is very necessary because all Sum do is preventing users from believing that "append" can create new slices (however, it not).

Types

This section is empty.

Jump to

Keyboard shortcuts

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