summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2013-09-19 00:52:20 +0200
committerKevin Chabowski <kevin@kch42.de>2013-09-19 00:52:20 +0200
commita7a310f4ddd89826355661ad4a2f560ae5ca42eb (patch)
tree139781223e8ae67a6ba09df4ce1b9cc8722f4a35
parenteb4e07103adf990f664417198db5b8792f1f8449 (diff)
downloadbiomed-a7a310f4ddd89826355661ad4a2f560ae5ca42eb.tar.gz
biomed-a7a310f4ddd89826355661ad4a2f560ae5ca42eb.tar.bz2
biomed-a7a310f4ddd89826355661ad4a2f560ae5ca42eb.zip
Fixed bug in fix{Freeze,Melt}
Since glass does not reduce the light level the height map does not give us the highest non-air block, if that block is glass, because the height map saves the block with the highest Y value that could get full sunlight. This will slow down fixing the weather conditions, but now snow can not fall through glass.
-rw-r--r--region_wrapper.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/region_wrapper.go b/region_wrapper.go
index a56f8dd..2f8abe4 100644
--- a/region_wrapper.go
+++ b/region_wrapper.go
@@ -243,7 +243,7 @@ func (rw *RegionWrapper) GetBiomeAt(x, z int) (mcmap.Biome, bool) {
}
func fixFreeze(bx, bz int, chunk *mcmap.Chunk) (newcol *gdk.Color) {
- for y := chunk.Height(bx, bz); y >= 0; y-- {
+ for y := mcmap.ChunkSizeY - 1; y >= 0; y-- {
if blk := chunk.Block(bx, y, bz); blk.ID != mcmap.BlkAir {
if (blk.ID == mcmap.BlkStationaryWater) || (blk.ID == mcmap.BlkWater) {
blk.ID = mcmap.BlkIce
@@ -265,7 +265,7 @@ func fixFreeze(bx, bz int, chunk *mcmap.Chunk) (newcol *gdk.Color) {
}
func fixMelt(bx, bz int, chunk *mcmap.Chunk) (newcol *gdk.Color) {
- for y := chunk.Height(bx, bz); y >= 0; y-- {
+ for y := mcmap.ChunkSizeY - 1; y >= 0; y-- {
if blk := chunk.Block(bx, y, bz); blk.ID != mcmap.BlkAir {
if blk.ID == mcmap.BlkIce {
blk.ID = mcmap.BlkStationaryWater