def drawBoard(board, mc): global boardBottomLeft, boardWidth, boardHeight for x in range(boardWidth): for y in range(boardHeight): #print x,y,board[x][y] colourId = board[x][y] mc.setBlock(boardBottomLeft.x + x, boardBottomLeft.y + y, boardBottomLeft.z, WOOL.withData(colourId))
def drawPalettes(initialPlayerPos, mc): # Draws the six color palettes at the bottom of the playArea. palettePosition = copy.deepcopy(initialPlayerPos) palettePosition.x += PALETTE_OFFSET[0] palettePosition.y += PALETTE_OFFSET[1] palettePosition.z += PALETTE_OFFSET[2] xShift = 0 for colour in paletteColors: mc.setBlock(palettePosition.x + xShift, palettePosition.y, palettePosition.z, WOOL.withData(colour)) xShift += 1
def getWoolBlockWithRandomColour(): #Generate a random number within the allowed range of colours (0 to 15 inclusive) randomNumber = randint(0,15) print("random number to be used = "+ str(randomNumber)) block = WOOL.withData(randomNumber) return block