From 230c827d579d868327f7b0ef31284e1154c80f06 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Mon, 12 Aug 2013 14:59:37 +0200 Subject: Chunks are now marked at unused in a function of Chunk. --- mcmap/region.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'mcmap/region.go') diff --git a/mcmap/region.go b/mcmap/region.go index 67966aa..0e569da 100644 --- a/mcmap/region.go +++ b/mcmap/region.go @@ -198,7 +198,7 @@ func (reg *Region) Chunk(x, z int) (*Chunk, error) { } var err error - if chunk, err = pc.toChunk(); err != nil { + if chunk, err = pc.toChunk(reg); err != nil { return nil, err } sc.chunks[cPos] = chunk @@ -211,8 +211,7 @@ func (reg *Region) Chunk(x, z int) (*Chunk, error) { return chunk, nil } -// UnloadChunk marks a chunk as unused. If all chunks of a superchunk are marked as unused, the superchunk will be unloaded and saved (if needed). -func (reg *Region) UnloadChunk(x, z int) error { +func (reg *Region) unloadChunk(x, z int) error { scx, scz, cx, cz := chunkToSuperchunk(x, z) scPos := XZPos{scx, scz} cPos := XZPos{cx, cz} @@ -264,7 +263,7 @@ func (reg *Region) AllChunks() <-chan XZPos { return ch } -// Save saves modified and unloaded chunks. +// Save saves modified and unused chunks. func (reg *Region) Save() error { return reg.cleanSuperchunks(true) } -- cgit v1.2.3-54-g00ecf