Created
May 11, 2014 19:08
-
-
Save henrygarner/7799e8176c57884b880b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mcpi.minecraft import Minecraft | |
import mcpi.block as block | |
mc = Minecraft.create() | |
pos = mc.player.getTilePos() | |
width = 6 | |
depth = 5 | |
height = 4 | |
def isWall(x, y, z): | |
return (x == 0 or x == width - 1 or | |
z == 0 or z == depth - 1) | |
def isRoof(x, y, z): | |
return y == height - 1 | |
for x in range(width): | |
for y in range(height): | |
for z in range(depth): | |
if isRoof(x, y, z): | |
mc.setBlock(pos.x + x, pos.y + y, pos.z + z, block.GLASS) | |
elif isWall(x, y, z): | |
mc.setBlock(pos.x + x, pos.y + y, pos.z + z, block.COBBLESTONE) | |
else: | |
mc.setBlock(pos.x + x, pos.y + y, pos.z + z, block.AIR) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment