From bc5f8dc9e4406d41a4b4cf8b8039888cb2c60e71 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Thu, 15 Aug 2013 14:53:15 +0200 Subject: Fixed offset calculation for biomes. --- mcmap/chunk.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mcmap/chunk.go b/mcmap/chunk.go index d11d24b..7214831 100644 --- a/mcmap/chunk.go +++ b/mcmap/chunk.go @@ -52,7 +52,7 @@ type Chunk struct { modified bool blocks []Block // Ordered YZX - biomes []Biome // Ordered XZ + biomes []Biome // Ordered ZX reg *Region } @@ -98,10 +98,10 @@ func (c *Chunk) Iter(fx func(int, int, int, *Block)) { } // Biome gets the Biome at x,z. -func (c *Chunk) Biome(x, z int) Biome { return c.biomes[x*ChunkSizeXZ+z] } +func (c *Chunk) Biome(x, z int) Biome { return c.biomes[z*ChunkSizeXZ+x] } // SetBiome sets the biome at x,z. -func (c *Chunk) SetBiome(x, z int, bio Biome) { c.biomes[x*ChunkSizeXZ+z] = bio } +func (c *Chunk) SetBiome(x, z int, bio Biome) { c.biomes[z*ChunkSizeXZ+x] = bio } // MarkUnused marks the chunk as unused. If all chunks of a superchunk are marked as unused, the superchunk will be unloaded and saved (if needed). // -- cgit v1.2.3-54-g00ecf