From 65cd1e927dad641fbc4f670ca1475d36edfd6961 Mon Sep 17 00:00:00 2001 From: lualbu <34267091+lualbu@users.noreply.github.com> Date: Tue, 2 Jan 2018 19:50:55 +0100 Subject: [PATCH 1/2] Mine.py Create a mine in a direction with given size --- Magic_Wand/Mine.py | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 Magic_Wand/Mine.py diff --git a/Magic_Wand/Mine.py b/Magic_Wand/Mine.py new file mode 100644 index 0000000..eaca144 --- /dev/null +++ b/Magic_Wand/Mine.py @@ -0,0 +1,87 @@ +from mcpi.minecraft import Minecraft +mc=Minecraft.create() +xp,yp,zp=mc.player.getTilePos() + +def airx(x,y): + mc.setBlocks(x,y,zp,x,y+2,zp,0) + + +def airz(z,y): + mc.setBlocks(xp,y,z,xp,y+2,z,0) + + +def isAirx(x,y): + if mc.getBlock(x,y,zp) == 0: + return True + else: + return False + +def isAirz(z,y): + if mc.getBlock(xp,y,z) == 0: + return True + else: + return False + + + + +def Mine(x,y,z,direction,size): + if size >= yp+50: + mc.postToChat("it is too big") + if direction == "North": + for i in range(size): + airz(z-(i+1),y-(i+1)) + mc.setBlock(x,y-(i+2),z-(i+1),67,2) #stairs + mc.setBlock(x,y-1,z,67,2) + for i in range(size//5): + mc.setBlock(x,y-(1+i)*5,z-(1+i)*5,50,2) #torches + for i in range(size): + if isAirz(z-(1+i),y-(1+i)) is False: + Mine(x,y,z,direction,size) + mc.postToChat("Work Done") + if direction == "South": + for i in range(size): + airz(z+(i+1),y-(i+1)) + mc.setBlock(x,y-(i+2),z+(i+1),67,3) + mc.setBlock(x,y-1,z,67,3) + for i in range(size//5): + mc.setBlock(x,y-(1+i)*5,z+(1+i)*5,50,1) + for i in range(size): + if isAirz(z+(1+i),y-(1+i)) is False: + Mine(x,y,z,direction,size) + mc.postToChat("Work Done") + if direction == "East": + for i in range(size): + airx(x+(i+1),y-(i+1)) + mc.setBlock(x+(i+1),y-(i+2),z,67,1) + mc.setBlock(x,y-1,z,67,1) + for i in range(size//5): + mc.setBlock(x+(1+i)*5,y-(1+i)*5,z,50,4) + for i in range(size): + if isAirx(x-(1+i),y-(1+i)) is False: + Mine(x,y,z,direction,size) + mc.postToChat("Work Done") + if direction == "West": + for i in range(size): + airx(x-(i+1),y-(i+1)) + mc.setBlock(x-(i+1),y-(i+2),z,67,0) + mc.setBlock(x,y-1,z,67,0) + for i in range(size//5): + mc.setBlock(x-(1+i)*5,y-(1+i)*5,z,50,3) + for i in range(size): + if isAirx(x-(1+i),y-(1+i)) is False: + Mine(x,y,z,direction,size) + mc.postToChat("Work Done") + + +#Mine(xp,yp,zp,"South",23) Exemple + + + + + + + + + + From 43f612929138f1492ee9867a63582231838733c8 Mon Sep 17 00:00:00 2001 From: lualbu <34267091+lualbu@users.noreply.github.com> Date: Wed, 3 Jan 2018 14:43:15 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Create=20D=C3=A9penses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Magic_Wand/D\303\251penses" | 1 + 1 file changed, 1 insertion(+) create mode 100644 "Magic_Wand/D\303\251penses" diff --git "a/Magic_Wand/D\303\251penses" "b/Magic_Wand/D\303\251penses" new file mode 100644 index 0000000..8bcf0bb --- /dev/null +++ "b/Magic_Wand/D\303\251penses" @@ -0,0 +1 @@ +1 x SPEEDLINK TWOXO (Stéréo) CHF 19.00 incl.