Example #1
0
# opis
# Zmieniajac 2 (wysokosc) parametr polecenia 'setBlock', zbuduj ceglane schody (BRICK_BLOCK)
# 1 ) Startujac z pozycji 0 0 0.
# Schody powinny miec wysokosc 100 elementow

from mine import Minecraft, block

minecraft = Minecraft()

for i in range(100):
    minecraft.setBlock(i, i, 0, block.BRICK_BLOCK)
Example #2
0
                    if y + 1 < height:
                        if 0 < x:
                            pixels[x-1][y+1][i] += err * 3 // 16
                        pixels[x][y+1][i] += err * 5 // 16
                        if x + 1 < width:
                            pixels[x+1][y+1][i] += err // 16
    else:
        raise ValueError('Unknown dithering algorithm')

if __name__ == '__main__':
    from mine import Minecraft
    
    mc = Minecraft()
    pos = mc.player.getTilePos()
    
    r = 50
    cx = pos.x
    cy = pos.y + r
    cz = pos.z
    
    for x in range(-r,r+1):
        for y in range(-r,r+1):
            d = math.sqrt(x*x+y*y)/r
            if d<=1:
                if x == 0 and y == 0:
                    theta = 0
                else:
                    theta = math.atan2(y,x) * 180. / math.pi
                rgb = hsvToRGB(theta, d, 1)
                mc.setBlock(cx+x,cy+y,cz,rgbToBlock(rgb, randomDither=30))
Example #3
0
# opis
# Zmieniajac drugi (wysokosc) parametr polecenia 'setBlock', zbuduj piaskowa konstrukcje z (BRICK_BLOCK)
# Startujac z pozycji 0 0 0.
# Wieza powinna:
# 1) miec wysokosc 20 elementow
# 2) co 5 blok powinnien byc dynamietem (TNT)

from mine import Minecraft, block

minecraft = Minecraft()

for i in range(20):
    if i == 5:
        minecraft.setBlock(0, i, 0, block.BRICK_BLOCK)
    else:
        minecraft.setBlock(0, i, 0, block.TNT)
Example #4
0
from mine import Minecraft, block

world = Minecraft()

for i in range(10):
    for j in range(10):
        for k in range(10):
            if (i == 9 and j == 8 and k == 9):
                world.setBlock(i, j, k, block.AIR)
            elif (i == 9 and j == 9 and k == 9):
                world.setBlock(i, j, k, block.TNT)
            else:
                world.setBlock(i, j, k, block.WOOD)

for i in range(8):
    for j in range(9):
        for k in range(8):
            world.setBlock(i + 1, j + 1, k + 1, block.WATER)
Example #5
0
# petle (loops)
# Zmieniajac 2 (wysokosc) parametr polecenia 'setBlock',
# zbuduj piaskowa wieze (RED_SAND)
# Startujac z pozycji 0 0 0.
# Wieza powinna miec wysokosc 100 elementow

from mine import Minecraft, block

minecraft = Minecraft()

for wysokosc in range(100):
    minecraft.setBlock(0, wysokosc, 0, block.RED_SAND)
Example #6
0
# polecenie "setBlock"
# Uzycie funkcji `mc.setBlock(x, y, z, material)` tak,
# zeby rozstawic 5 roznych materialow w pozycjach:
# 1) 0, 0, 0 z materialem block.GLASS
# 2) 0, 10, 0 z materialem block.WOOD
# 3) 0, 0, 10 z materialem  block.MELON
# 4) 0, 10, 10 z materialem block.GOLD_BLOCK
# 5) W dowolnym miejscu, z dowolnym materialem. Znajdz i zaprezentuj
from mine import Minecraft, block

minecraft = Minecraft()

minecraft.setBlock(0, 0, 0, block.GLASS)
minecraft.setBlock(0, 10, 0, block.WOOD)
minecraft.setBlock(0, 0, 10, block.MELON)
minecraft.setBlock(10, 10, 10, block.GOLD_BLOCK)
Example #7
0
# polecenie "setBlock"
# Zbuduj wieze skladajaca sie z 5 blokow,
# w ktorej 1 blok znajduje sie punkcie (0,0,0)
# Z materialu TNT (dynamit) i wysadz wszystko w powietrze (pochodnia redstone)

from mine import Minecraft, block

minecraft = Minecraft()

minecraft.setBlock(0, 0, 0, block.TNT)
minecraft.setBlock(0, 1, 0, block.TNT)
minecraft.setBlock(0, 2, 0, block.TNT)
minecraft.setBlock(0, 3, 0, block.TNT)
minecraft.setBlock(0, 4, 0, block.TNT)
Example #8
0
# polecenie "setBlock"
# Uzycie funkcji `mc.setBlock(x, y, z, material)` tak,
# zeby postawic blok (block.GLASS) w centrum swiata (0, 0, 0)

from mine import Minecraft, block

minecraft = Minecraft()

minecraft.setBlock(0, 0, 0, block.GLASS)