Skip to content

Commit

Permalink
Update MCPI-WorldEdit-V0.1A.py
Browse files Browse the repository at this point in the history
Added a data option (type 0 for normal)
  • Loading branch information
scratchermatch authored Feb 26, 2020
1 parent 3ba2777 commit e5a621d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions MCPI-WorldEdit-V0.1A.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def getPos2():
pos2z = round(pos2z, 0)
mc.postToChat("Pos 2 is set to (" + str(pos2x) + ", " + str(pos2y) + ", " + str(pos2z) + ")")

def setBlocks(data = 0):
def cuboid(data):
global pos1x, pos1y, pos1z, pos2x, pos2y, pos2z, blockID
int(blockID)
mc.setBlocks(pos1x - 1, pos1y - 1 ,pos1z - 1, pos2x + 1, pos2y - 1, pos2z + 1, blockID)
mc.setBlocks(pos1x, pos1y - 1 ,pos1z, pos2x, pos2y - 1, pos2z, blockID, data)

def toggle_world():
global worldType
Expand Down Expand Up @@ -61,17 +61,23 @@ def on_press(key):

def on_release(key):
print('{0} pressed'.format(key))
global blockID
global blockID, data
if key == Key.up:
toggle_world()
if key == Key.left:
getPos1()
if key == Key.right:
getPos2()
if key == Key.down:
blockID = int(input("Choose block ID: "))
setBlocks()

try:
blockID = int(input("Choose block ID: "))
except ValueError:
return
try:
data = int(input("Block Data:"))
except ValueError:
return
cuboid(data)

# Collect events until released
with Listener(
Expand Down

0 comments on commit e5a621d

Please sign in to comment.