diff options
author | Kevin Chabowski <kevin@kch42.de> | 2013-09-21 00:48:59 +0200 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2013-09-21 00:48:59 +0200 |
commit | f051ce2392bc0bfae52945e8f53fe38f2d095637 (patch) | |
tree | 9cf7e28b009757747d12c5d4ac3e36a6469d4295 /mcmap/chunk.go | |
parent | fc3743db98c3cc9f800cd50ae087e505ff260c0c (diff) | |
download | gomcmap-f051ce2392bc0bfae52945e8f53fe38f2d095637.tar.gz gomcmap-f051ce2392bc0bfae52945e8f53fe38f2d095637.tar.bz2 gomcmap-f051ce2392bc0bfae52945e8f53fe38f2d095637.zip |
Deleting chunks implemented.
Diffstat (limited to 'mcmap/chunk.go')
-rw-r--r-- | mcmap/chunk.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mcmap/chunk.go b/mcmap/chunk.go index 9196776..dfac5a7 100644 --- a/mcmap/chunk.go +++ b/mcmap/chunk.go @@ -54,6 +54,8 @@ type Chunk struct { blocks []Block // Ordered YZX biomes []Biome // Ordered ZX + deleted bool + reg *Region } @@ -132,6 +134,9 @@ func (c *Chunk) SetBiome(x, z int, bio Biome) { c.biomes[z*ChunkSizeXZ+x] = bio // If the chunk was modified, call MarkModified BEFORE. func (c *Chunk) MarkUnused() error { return c.reg.unloadChunk(int(c.x), int(c.z)) } +// MarkDeleted marks this chunk as deleted. After marking it as unused, it will be deleted and can no longer be used. +func (c *Chunk) MarkDeleted() { c.deleted = true } + // RecalcHeightMap recalculates the internal height map. // // You should use this function before marking the chunk as unused, if you modified the chunk |