def getBlock(self, coordinate): i, j = [Utility.round(k) for k in coordinate] i, j = self.coordinateToIndex((i, j)) if i < 0 or i >= self.width or j < 0 or j >= self.height: return Constants.AIR_BLOCK block = self.blocks[j][i] return block
def setBlock(self, blockType, coordinate): i, j = [Utility.round(k) for k in coordinate] i, j = self.coordinateToIndex((i, j)) self.blocks[j][i] = Block(blockType, i, j)