Hardware Reference
In-Depth Information
sizey = int(coords[1])
sizez = int(coords[2])
lineidx = 1
for y in range(sizey):
mc.postToChat("print:" + str(y))
lineidx = lineidx + 1
for x in range(sizex):
line = lines[lineidx]
lineidx = lineidx + 1
data = line.split(",")
for z in range(sizez):
blockid = int(data[z])
mc.setBlock(originx+x, originy+y, originz+z,
blockid)
Save the program and run it again. Test that you can build something in the room,
then run to somewhere in the Minecraft world and choose option 5 from the menu.
The contents of the room are scanned then printed just to the side of where your player
is standing. You should be able to run to anywhere in the Minecraft world and dupli-
cate your objects many times. Try duplicating objects in the sky and under water to see
what happens! Figure 6-11 shows the results of running this program.
FIGURE 6-11 A stone shape in the room and printed next to your player
Search WWH ::




Custom Search