biome: for Y -1, return the first biome
Apparently rotated worlds would try to access the biome for Y-level -1. I don't know why they do that (probably some dumb reason that may be a bug in of itself) but returning the first level should be harmless. Fixes #1683.
This commit is contained in:
@@ -32,9 +32,7 @@ class BiomeDispensary:
|
|||||||
self.biomes[i] = biome_array[i * 256:(i + 1) * 256].reshape((16, 16))
|
self.biomes[i] = biome_array[i * 256:(i + 1) * 256].reshape((16, 16))
|
||||||
|
|
||||||
def get_biome(self, y_level):
|
def get_biome(self, y_level):
|
||||||
if y_level < 0:
|
if self.biome_len == 256 or y_level < 0:
|
||||||
return None
|
|
||||||
if self.biome_len == 256:
|
|
||||||
return self.biomes[0]
|
return self.biomes[0]
|
||||||
else:
|
else:
|
||||||
return self.biomes[y_level // 4]
|
return self.biomes[y_level // 4]
|
||||||
|
|||||||
Reference in New Issue
Block a user