Initial commit

This commit is contained in:
BarsTigerMeowcat
2020-01-26 12:49:01 +02:00
commit 8bed7171c2
125 changed files with 3212 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
import random
def brokenBlock():
brokenBlocks = [48, 67, 4, 4, 4, 4]
block = random.choice(brokenBlocks)
return block
pos = mc.player.getTilePos()
x, y, z = pos.x, pos. y, pos.z
brokenWall = []
height, width = 5, 10
for row in range(height):
brokenWall.append([])
for column in range(width):
block = brokenBlock()
brokenWall[row].append(block)
for row in brokenWall:
for block in row:
mc.setBlock(x, y, z, block)
x += 1
time.sleep(0.1)
y += 1
x = pos.x

View File

@@ -0,0 +1,62 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
def sortPair(val1, val2):
if val1 > val2:
return val2, val1
else:
return val1, val2
def copyStructure(x1, y1, z1, x2, y2, z2):
x1, x2 = sortPair(x1, x2)
y1, y2 = sortPair(y1, y2)
z1, z2 = sortPair(z1, z2)
width = x2 - x1
height = y2 - y1
length = z2 - z1
structure = []
print("Подождите, пока мы смотрим видео про котиков и заставляем себя начать копировать блоки воздуха, которые вы случайно добавили в пространство копирования, в список")
print("ЧТО? Так быстро закончилось видео? Ну ладно, начинаем. А вы пока покормите своих оцелотов")
for row in range(height):
structure.append([])
for column in range(width):
structure[row].append([])
for depth in range(length):
block = mc.getBlock(x1 + column, y1 + row, z1 + depth)
structure[row][column].append(block)
return structure
def buildStructure(x, y, z, structure):
xStart = x
zStart = z
for row in structure:
for column in reversed(row):
for block in column:
mc.setBlock(x, y, z, block)
z += 1
x += 1
z = zStart
y += 1
x = xStart
input("Подойдите к одному углу констукции и нажмите ")
pos = mc.player.getTilePos()
x1, y1, z1 = pos.x, pos.y, pos.z
input("Подойдите к противоположному углу и нажмите ")
pos = mc.player.getTilePos()
x2, y2, z2 = pos.x, pos.y, pos.z
structure = copyStructure(x1, y1, z1, x2, y2, z2)
input("Мы закончили страдать фигней, и делать что-то вместо копирования(даже как-то успели все скопировать), поэтому подойдите к месту, куда хотите поставить постройку и нажмите тут ")
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
buildStructure(x, y, z, structure)
print("СМОТРИТЕ" + str(structure) + " - это тот список в который мы засунули блоки")

View File

@@ -0,0 +1,24 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
cube = [[[57, 57, 57, 57], [57, 0, 0, 57], [57, 0, 0, 57], [57, 57, 57, 57]],
[[57, 0, 0, 57], [0, 0, 0, 0], [0, 0, 0, 0], [57, 0, 0, 57]],
[[57, 0, 0, 57], [0, 0, 0, 0], [0, 0, 0, 0], [57, 0, 0, 57]],
[[57, 57, 57, 57], [57, 0, 0, 57], [57, 0, 0, 57], [57, 57, 57, 57]]]
startingX, startingY = x, y
for depth in cube:
for heigth in reversed(depth):
for block in heigth:
mc.setBlock(x, y, z, block)
x += 1
time.sleep(0.1)
y += 1
x = startingX
z += 1
y = startingY

View File

@@ -0,0 +1,24 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
pos = mc.player.getPos()
x, y, z = pos.x, pos.y, pos.z
podnozniyBlock = mc.getBlock(x, y, z)
blockPodNogami = []
for item in range(80):
blockPodNogami.append(podnozniyBlock)
y = y - 1
podnozniyBlock = mc.getBlock(x, y, z)
if 56 in blockPodNogami:
mc.postToChat("Almazi na pribliz. glubine " + str(blockPodNogami.index(56)))
break
else:
mc.postToChat("Rudi net :(")
print(blockPodNogami)

View File

@@ -0,0 +1,14 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
block = int(input("Введите ID блока, в который превратятся ударённые вами блоки(103-арбуз, 57-алмаз и т.д.) "))
time.sleep(10)
hits = mc.events.pollBlockHits()
for hit in hits:
x, y, z = hit.pos.x, hit.pos.y, hit.pos.z
mc.setBlock(x, y, z, block)

View File

@@ -0,0 +1,30 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
def setPillar(x, y, z, height):
stairBlock = 156
block = 155
mc.setBlocks(x - 1, y + height, z - 1, x + 1, y + height, z + 1, block, 1)
mc.setBlock(x - 1, y + height - 1, z, stairBlock, 12)
mc.setBlock(x + 1, y + height - 1, z, stairBlock, 13)
mc.setBlock(x, y + height - 1, z + 1, stairBlock, 15)
mc.setBlock(x, y + height - 1, z - 1, stairBlock, 14)
mc.setBlocks(x - 1, y, z - 1, x + 1, y, z + 1, block, 1)
mc.setBlock(x - 1, y + 1, z, stairBlock, 0)
mc.setBlock(x + 1, y + 1, z, stairBlock, 1)
mc.setBlock(x, y + 1, z + 1, stairBlock, 3)
mc.setBlock(x, y + 1, z - 1, stairBlock, 2)
mc.setBlocks(x, y, z, x, y + height, z, block, 2)
pos = mc.player.getTilePos()
x, y, z = pos.x + 2, pos.y, pos.z
skolkoKolonn = int(input("Сколько колонн? "))
rasstoyanie = int(input("Сколько расстояние между колоннами? "))
visota = int(input("Какой высоты колонны? "))
for item in range(0, skolkoKolonn):
setPillar(x + item * rasstoyanie, y, z, visota)

View File

@@ -0,0 +1,25 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
pos = mc.player.getTilePos()
x, y, z = pos.x, pos.y, pos.z
blocks = [[35, 35, 22, 22, 22, 22, 35, 35],
[35, 22, 35, 35, 35, 35, 22, 35],
[22, 35, 22, 35, 35, 22, 35, 22],
[22, 35, 35, 35, 35, 35, 35, 22],
[22, 35, 22, 35, 35, 22, 35, 22],
[22, 35, 35, 22, 22, 35, 35, 22],
[22, 35, 35, 35, 35, 35, 35, 22],
[35, 22, 35, 35, 35, 35, 22, 35],
[35, 35, 22, 22, 22, 22, 35, 35]]
for row in reversed(blocks):
for block in row:
mc.setBlock(x, y, z, block)
x += 1
time.sleep(0.1)
y += 1
x = pos.x

View File

@@ -0,0 +1,13 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
block = 24
height = int(input("Введите высоту пирамиды "))
levels = reversed(range(height))
pos = mc.player.getTilePos()
x, y, z = pos.x + height, pos.y, pos.z
for level in levels:
mc.setBlocks(x - level, y, z - level, x + level, y, z + level, block)
y += 1

View File

@@ -0,0 +1,19 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
twoDimensionalRainbowList = [[0, 0, 0],
[1, 1, 1],
[2, 2, 2],
[3, 3, 3],
[4, 4, 4],
[5, 5, 5]]
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
startingX = x
for row in twoDimensionalRainbowList:
for color in row:
mc.setBlock(x, y, z, 35, color)
x += 1
y += 1
x = startingX

View File

@@ -0,0 +1,12 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
oneDimensionalRainbowList = [0, 1, 2, 3, 4, 5]
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
for color in oneDimensionalRainbowList:
mc.setBlock(x, y, z, 35, color)
y += 1

View File

@@ -0,0 +1,20 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
pos = mc.player.getTilePos()
stairBlock = 53
x, y, z = pos.x, pos.y, pos.z
dlina = int(input("Какой высоты будет лестница? "))
for item in range(0, dlina):
mc.setBlock(x + item, y + item, z, stairBlock)
input("Нажмите ENTER, чтобы удалить лестницу ")
for nomerDel in range(0, dlina):
mc.setBlock(x + nomerDel, y + nomerDel, z, 0)

View File

@@ -0,0 +1,25 @@
from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import time
name = ""
scoreboard = {}
while True:
name = input("Джедай ударов по блокам правой кнопкой меча, имя свое введи... (выйти дабы, простое слово стоп введи) ")
if name == "стоп":
break
time.sleep(0.5)
mc.postToChat("Nachinaem! Da prebudet s vami sila!!!")
time.sleep(15)
blockHits = mc.events.pollBlockHits()
blockHitsLength = len(blockHits)
mc.postToChat("Vash chet " + str(blockHitsLength))
scoreboard[name] = blockHitsLength
for name in scoreboard:
print(name + "-" + str(scoreboard[name]))