Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775)
Vanilla-faithful overworld generator (final_density + multi-noise biomes), full connection lifecycle (status/login/configuration/play), chunk streaming, creative block editing, and the protocol/nbt/registry infrastructure.
This commit is contained in:
commit
a7bb9496ae
146 changed files with 217621 additions and 0 deletions
23
internal/world/chunk.go
Normal file
23
internal/world/chunk.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Package world provides chunk data for the play phase: an in-memory chunk
|
||||
// representation, the level_chunk_with_light encoder, and (for now) a flat
|
||||
// world generator. Real noise-based generation arrives in a later sub-milestone.
|
||||
package world
|
||||
|
||||
// FlatSurfaceY is the Y of the topmost solid block (grass) in the flat world.
|
||||
// A player spawns one block above it.
|
||||
const FlatSurfaceY = -61
|
||||
|
||||
// GenerateFlat builds a Classic-Flat-style chunk at (cx, cz): bedrock at the
|
||||
// world floor, two dirt layers, and a grass surface, all under a plains biome.
|
||||
func GenerateFlat(cx, cz int32) *Chunk {
|
||||
c := NewChunk(cx, cz, BiomePlains)
|
||||
for lx := 0; lx < 16; lx++ {
|
||||
for lz := 0; lz < 16; lz++ {
|
||||
c.SetBlock(lx, MinY+0, lz, StateBedrock)
|
||||
c.SetBlock(lx, MinY+1, lz, StateDirt)
|
||||
c.SetBlock(lx, MinY+2, lz, StateDirt)
|
||||
c.SetBlock(lx, FlatSurfaceY, lz, StateGrass)
|
||||
}
|
||||
}
|
||||
return c
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue