Initial commit
This commit is contained in:
28
myOwnProjects/coolBuild/coolBuild.py
Normal file
28
myOwnProjects/coolBuild/coolBuild.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from mcpi.minecraft import Minecraft
|
||||
mc = Minecraft.create()
|
||||
import pickle
|
||||
import time
|
||||
|
||||
def build(x, y, z, structure):
|
||||
xStart = x
|
||||
zStart = z
|
||||
for row in structure:
|
||||
for column in (row):
|
||||
for block in column:
|
||||
mc.setBlock(x, y, z, block)
|
||||
z += 1
|
||||
time.sleep(0.07)
|
||||
x += 1
|
||||
z = zStart
|
||||
y += 1
|
||||
x = xStart
|
||||
|
||||
|
||||
file = open("home.txt", "rb")
|
||||
structure = pickle.load(file)
|
||||
pos = mc.player.getTilePos()
|
||||
x = pos.x
|
||||
y = pos.y
|
||||
z = pos.z
|
||||
|
||||
build(x, y, z, structure)
|
||||
93
myOwnProjects/coolBuild/coolBuild2(betaNotGood).py
Normal file
93
myOwnProjects/coolBuild/coolBuild2(betaNotGood).py
Normal file
@@ -0,0 +1,93 @@
|
||||
from mcpi.minecraft import Minecraft
|
||||
mc = Minecraft.create()
|
||||
import pickle
|
||||
import time
|
||||
|
||||
def build(x, y, z, structure):
|
||||
xStart = x
|
||||
zStart = z
|
||||
for row in structure:
|
||||
for column in (row):
|
||||
for block in column:
|
||||
mc.setBlock(x, y, z, block)
|
||||
z += 1
|
||||
time.sleep(0.07)
|
||||
x += 1
|
||||
z = zStart
|
||||
y += 1
|
||||
x = xStart
|
||||
|
||||
def buildTest(x, y, z, structure):
|
||||
xStart = x
|
||||
zStart = z
|
||||
for row in structure:
|
||||
for column in (row):
|
||||
for block in column:
|
||||
mc.setBlock(x, y, z, block)
|
||||
z += 1
|
||||
x += 1
|
||||
z = zStart
|
||||
y += 1
|
||||
x = xStart
|
||||
|
||||
def buildDel(x, y, z, structure):
|
||||
xStart = x
|
||||
zStart = z
|
||||
for row in structure:
|
||||
for column in (row):
|
||||
for block in column:
|
||||
mc.setBlock(x, y, z, 0)
|
||||
z += 1
|
||||
x += 1
|
||||
z = zStart
|
||||
y += 1
|
||||
x = xStart
|
||||
|
||||
|
||||
file = open("home.txt", "rb")
|
||||
structure = pickle.load(file)
|
||||
pos = mc.player.getTilePos()
|
||||
x = pos.x
|
||||
y = pos.y
|
||||
z = pos.z
|
||||
|
||||
ans = 1
|
||||
|
||||
while ans != "ок" or ans != "ok":
|
||||
buildTest(x, y, z, structure)
|
||||
time.sleep(1)
|
||||
buildDel(x, y, z, structure)
|
||||
buildTest(x, y, z, structure)
|
||||
time.sleep(1)
|
||||
buildDel(x, y, z, structure)
|
||||
buildTest(x, y, z, structure)
|
||||
time.sleep(1)
|
||||
buildDel(x, y, z, structure)
|
||||
buildTest(x, y, z, structure)
|
||||
time.sleep(1)
|
||||
buildDel(x, y, z, structure)
|
||||
buildTest(x, y, z, structure)
|
||||
time.sleep(1)
|
||||
buildDel(x, y, z, structure)
|
||||
buildTest(x, y, z, structure)
|
||||
time.sleep(1)
|
||||
buildDel(x, y, z, structure)
|
||||
buildTest(x, y, z, structure)
|
||||
time.sleep(1)
|
||||
buildDel(x, y, z, structure)
|
||||
buildTest(x, y, z, structure)
|
||||
time.sleep(1)
|
||||
buildDel(x, y, z, structure)
|
||||
buildTest(x, y, z, structure)
|
||||
time.sleep(1)
|
||||
buildDel(x, y, z, structure)
|
||||
ans = input("Если вы довольны постройкой и местом постройки введите ок. Если нет - нет или no ")
|
||||
if ans == "нет" or ans == "no":
|
||||
buildDel(x, y, z, structure)
|
||||
break
|
||||
if ans == "ок" or ans == "ok":
|
||||
buildDel(x, y, z, structure)
|
||||
break
|
||||
|
||||
|
||||
build(x, y, z, structure)
|
||||
41
myOwnProjects/coolBuild/coolBuild3.py
Normal file
41
myOwnProjects/coolBuild/coolBuild3.py
Normal file
@@ -0,0 +1,41 @@
|
||||
from mcpi.minecraft import Minecraft
|
||||
mc = Minecraft.create()
|
||||
import pickle
|
||||
import time
|
||||
|
||||
nameNumber = int(input("Введите номер постройки, которую хотите: 1 - дом чуток хай-тек; 2 - 'коробка' про; 3 - деревенский дом; 4 - дом-куча нуба "))
|
||||
name = 0
|
||||
|
||||
if nameNumber == 1:
|
||||
name = "home.txt"
|
||||
elif nameNumber == 2:
|
||||
name = "probox.txt"
|
||||
elif nameNumber == 3:
|
||||
name = "vilage.txt"
|
||||
elif nameNumber == 4:
|
||||
name = "noob.txt"
|
||||
|
||||
|
||||
def build(x, y, z, structure):
|
||||
xStart = x
|
||||
zStart = z
|
||||
for row in structure:
|
||||
for column in (row):
|
||||
for block in column:
|
||||
mc.setBlock(x, y, z, block)
|
||||
z += 1
|
||||
time.sleep(0.07)
|
||||
x += 1
|
||||
z = zStart
|
||||
y += 1
|
||||
x = xStart
|
||||
|
||||
|
||||
file = open(name, "rb")
|
||||
structure = pickle.load(file)
|
||||
pos = mc.player.getTilePos()
|
||||
x = pos.x
|
||||
y = pos.y
|
||||
z = pos.z
|
||||
|
||||
build(x, y, z, structure)
|
||||
BIN
myOwnProjects/coolBuild/home.txt
Normal file
BIN
myOwnProjects/coolBuild/home.txt
Normal file
Binary file not shown.
BIN
myOwnProjects/coolBuild/noob.txt
Normal file
BIN
myOwnProjects/coolBuild/noob.txt
Normal file
Binary file not shown.
BIN
myOwnProjects/coolBuild/probox.txt
Normal file
BIN
myOwnProjects/coolBuild/probox.txt
Normal file
Binary file not shown.
BIN
myOwnProjects/coolBuild/vilage.txt
Normal file
BIN
myOwnProjects/coolBuild/vilage.txt
Normal file
Binary file not shown.
Reference in New Issue
Block a user