Documentation
¶
Index ¶
Constants ¶
View Source
const ( None = iota Gzip Zlib )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chunk ¶
type Chunk struct {
X int32 `xPos` // X position of the chunk
Z int32 `zPos` // Z position of the chunk
LastUpdate int64 `LastUpdate` // Tick when the chunk was last saved.
TerrainPopulated bool `TerrainPopulated` // false=NMC resets world.
Biomes [256]byte `Biomes` // -1=NMC reset biome.
HeightMap [256]int32 `HeightMap` // Lowest Y light is at full strength. ZX.
Sections [16]*Section `Sections` // 16x16x16 blocks.
Entities []Entity `Entities` // List of NBT Compound.
TileEntities []TileEntity `TileEntities` // List of NBT Compound.
TileTicks []TileTick `TileTicks` // List of NBT Compound.
}
Chunk
Note: All fields are children of root's compound tag named "Level".
type Entity ¶
type Entity struct {
Id string // Entity ID. Doesn't exist for players.
X, Y, Z float64 // Pos.
Dx, Dy, Dz float64 // Velocity. Unit: meters per tick.
Yaw, Pitch float32 // Look. Unit: degrees.
FallDistance float32 // Distance the entity has fallen.
Fire int16 // Fire ticks left or inmune ticks iff Fire < 0.
Air int16 // Air ticks left. Max: 200 (10s). Decreases under water.
OnGround bool // Captain Obvious!
Dimension int32 // Unknown usage.
Invulnerable bool // Applies to living/nonliving entities.
PortalCooldown int32 // Starts at 900 ticks (45s) and decrements.
UUIDLeast int64 // Unused.
UUIDMost int64 // Unused.
Riding *Entity // Entity being ridden. Recursive.
}
type Region ¶
type Region struct {
Pos [1024]int32 // Chunk position in 4k increments from start.
Mod [1024]int32 // Last modification time of a chunk
Data [1024]struct {
Length int32
Chunk []byte
}
}
Region (.mca files) store 32x32 chunks.
type Section ¶
type Section struct {
Y byte // Y section index. 0~15 bottom to top.
Blocks [4096]byte // 8b/block. YZX.
Add [2048]byte // 4b/block. YZX. Add << 8 | Blocks
Data [2048]byte // 4b/block. YZX.
BlockLight [2048]byte // 4b/block. YZX.
SkyLight [2048]byte // 4b/block. YZX.
}
Section holds the 1/16 part of a chunk (16x16x16).
type TileEntity ¶
Click to show internal directories.
Click to hide internal directories.