Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getCommandBlocks(level, box, options):
- command = []
- find = options["Find In Command: "]
- for (chunk, slices, point) in level.getChunkSlices(box):
- for t in chunk.TileEntities:
- x = t["x"].value
- y = t["y"].value
- z = t["z"].value
- if x >= box.minx and x < box.maxx and y >= box.miny and y < box.maxy and z >= box.minz and z < box.maxz:
- if t["id"].value == "Control":
- if find == "N/A": command.append(t["Command"].value)
- if options["Print Commands After Selection"]: print("Command At: " +str(x)+"(x)"+" "+str(y)+"(y)"+" "+str(z)+ "(z)" + " " +"is: " + t["Command"].value + " ")
- if find != "N/A" and find in t["Command"].value:
- command.append(t["Command"].value)
- print("Found " + options["Find In Command: "] + " at " +str(x)+"(x)"+" "+str(y)+"(y)"+" "+str(z)+ "(z)" + " in " + t["Command"].value)
- elif find != "N/A": print("Could Not Find " + find + " in " + t["Command"].value + " at " +str(x)+"(x)"+" "+str(y)+"(y)"+" "+str(z)+ "(z)")
- if options["Delete Command Blocks After Selection"] and level.blockAt(x, y, z) == 137:
- level.setBlockAt(x, y, z, 0)
- return command
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement