diff options
author | Kevin Chabowski <kevin@kch42.de> | 2013-08-15 14:53:15 +0200 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2013-08-15 14:53:15 +0200 |
commit | bc5f8dc9e4406d41a4b4cf8b8039888cb2c60e71 (patch) | |
tree | 6a2bfc524a4a4af9b866241144ca49f0ce2dc1dc | |
parent | 2263d599391cce82735f16f43b7907e8846cbb2a (diff) | |
download | gomcmap-bc5f8dc9e4406d41a4b4cf8b8039888cb2c60e71.tar.gz gomcmap-bc5f8dc9e4406d41a4b4cf8b8039888cb2c60e71.tar.bz2 gomcmap-bc5f8dc9e4406d41a4b4cf8b8039888cb2c60e71.zip |
Fixed offset calculation for biomes.
-rw-r--r-- | mcmap/chunk.go | 6 |
1 files 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). // |