Documentation ¶
Index ¶
- Constants
- type Chunk
- func (c *Chunk) GetBlockLight(x, y, z int) int
- func (c *Chunk) GetBlockState(x, y, z int) uint16
- func (c *Chunk) GetSkyLight(x, y, z int) int
- func (c *Chunk) MakeChunkDataPacket(writer *minecraft.Writer)
- func (c *Chunk) MakeUpdateLightPacket(writer *minecraft.Writer)
- func (c *Chunk) SetBlockLight(x, y, z int, light int)
- func (c *Chunk) SetBlockState(x, y, z int, state uint16)
- func (c *Chunk) SetSkyLight(x, y, z int, light int)
Constants ¶
View Source
const ( // height in blocks of a chunk column ChunkHeight = 256 // width in blocks of a chunk column ChunkWidth = 16 // height in blocks of a chunk section SectionHeight = 16 // width in blocks of a chunk section SectionWidth = 16 // volume in blocks of a chunk section SectionVolume = SectionHeight * SectionWidth * SectionWidth // number of chunk sections in a chunk column NumSections = 16 // number of light sections in a chunk column NumLightSections = NumSections + 2 // number of elements in the light byte array LightVolume = (SectionHeight * SectionWidth * SectionWidth) / 2 // maximum number of bits per block allowed when using the section palette. // values above will switch to global palette MaxBitsPerBlock = 8 // number of bits used for each block in the global palette. // this value should not be hardcoded according to wiki.vg GlobalBitsPerBlock = 14 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chunk ¶
type Chunk struct {
X, Z int
// contains filtered or unexported fields
}
func (*Chunk) GetBlockLight ¶
func (*Chunk) GetBlockState ¶
func (*Chunk) GetSkyLight ¶
func (*Chunk) MakeChunkDataPacket ¶
Write the chunk data into the given writer in the Chunk Data format
NOTE: This does not include block entities! these are managed by the world
so they need to be written by the world as well!
func (*Chunk) MakeUpdateLightPacket ¶
TODO: maybe cache this
func (*Chunk) SetBlockLight ¶
func (*Chunk) SetBlockState ¶
func (*Chunk) SetSkyLight ¶
Click to show internal directories.
Click to hide internal directories.