diff --git a/chunk.py b/chunk.py index 440f3f8..ed3a3ad 100644 --- a/chunk.py +++ b/chunk.py @@ -676,8 +676,8 @@ class ChunkRenderer(object): biomeColorData = textures.getBiomeData(self.world.worlddir, self.chunkX, self.chunkY) # in the 32x32 block of biome data, what chunk is this?l - startX = (self.chunkX - int(math.floor(self.chunkX/32)*32)) - startY = (self.chunkY - int(math.floor(self.chunkY/32)*32)) + startX = self.chunkX % 32 + startY = self.chunkY % 32 # Each block is 24x24 # The next block on the X axis adds 12px to x and subtracts 6px from y in the image diff --git a/textures.py b/textures.py index ae06f87..da6b35e 100644 --- a/textures.py +++ b/textures.py @@ -850,10 +850,7 @@ def getBiomeData(worlddir, chunkX, chunkY): global currentBiomeFile, currentBiomeData - biomeFile = "b.%d.%d.biome" % ( - int(math.floor(chunkX/32)), - int(math.floor(chunkY/32)) - ) + biomeFile = "b.%d.%d.biome" % (chunkX // 32, chunkY // 32) if biomeFile == currentBiomeFile: return currentBiomeData