Advertisement
wiresegal

8720568

Feb 10th, 2014
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.14 KB | None | 0 0
  1. def getCommandBlocks(level, box, options):
  2.     command = []
  3.     find = options["Find In Command: "]
  4.     for (chunk, slices, point) in level.getChunkSlices(box):
  5.        
  6.         for t in chunk.TileEntities:
  7.             x = t["x"].value
  8.             y = t["y"].value
  9.             z = t["z"].value
  10.            
  11.             if x >= box.minx and x < box.maxx and y >= box.miny and y < box.maxy and z >= box.minz and z < box.maxz:
  12.                 if t["id"].value == "Control":
  13.                     if find == "N/A": command.append(t["Command"].value)
  14.                     if options["Print Commands After Selection"]: print("Command At: " +str(x)+"(x)"+" "+str(y)+"(y)"+" "+str(z)+ "(z)" + " " +"is: " + t["Command"].value + "                                                  ")
  15.                     if find != "N/A" and find in t["Command"].value:
  16.                         command.append(t["Command"].value)
  17.                         print("Found " + options["Find In Command: "] + " at " +str(x)+"(x)"+" "+str(y)+"(y)"+" "+str(z)+ "(z)" + " in " + t["Command"].value)
  18.                     elif find != "N/A": print("Could Not Find " + find + " in " + t["Command"].value + " at " +str(x)+"(x)"+" "+str(y)+"(y)"+" "+str(z)+ "(z)")
  19.                     if options["Delete Command Blocks After Selection"] and level.blockAt(x, y, z) == 137:
  20.                         level.setBlockAt(x, y, z, 0)
  21.     return command
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement