Hardware Reference
In-Depth Information
8. Calculate two variables called midx and midy , which are the midpoints of the
front of your house in the x and y directions. This will make it easier for you to
work out the coordinates of the windows and doorway later on, so that if you
change the size of your house, the windows and doorway will change their posi-
tion too and fit properly.
midx = x + SIZE/2
midy = y + SIZE/2
9. Build the outer shell of the house as a huge rectangular 3D area. You can choose any
block type here, but cobblestone is a good one to start with, making it an old house:
mc.setBlocks(x, y, z, x+SIZE, y+SIZE, z+SIZE,
block.COBBLESTONE.id)
10. Now carve out the inside of the house by filling it with air. Note how you have
used the simple maths from your design to work out the coordinates of the air
inside the house, as relative coordinates to the outer corners of the cobblestone
of the house:
mc.setBlocks(x+1, y, z+1, x+SIZE-2, y+SIZE-1, z+SIZE-2,
block.AIR.id)
11. Carve out a space for the doorway, again using the AIR block type. You won't use
a normal Minecraft door here, because this is a huge house. Instead you create a
large doorway that is three blocks high and two blocks wide. Your doorway needs
to be in the middle of the front face of the house, so midx gives you that middle
x coordinate:
mc.setBlocks(midx-1, y, z, midx+1, y+3, z, block.AIR.id)
12. Carve out two windows using the block type GLASS . As this is a large house, you
will build the windows three blocks from the outer edge of the house and three
blocks from the middle point of the front of the house. If you change your SIZE
constant and run the program again, all of the calculations in the program auto-
matically adjust the positioning of everything and the doorway and windows
will be in the right place so it still looks like a house.
mc.setBlocks(x+3, y+SIZE-3, z, midx-3, midy+3, z,
block.GLASS.id)
mc.setBlocks(midx+3, y+SIZE-3, z, x+SIZE-3, midy+3, z,
block.GLASS.id)
13. Add a wooden roof:
mc.setBlocks(x, y+SIZE-1, z, x+SIZE, y+SIZE-1, z+SIZE,
block.WOOD.id)
14. Now, add a woollen carpet:
mc.setBlocks(x+1, y-1, z+1, x+SIZE-2, y-1, z+SIZE-2,
block.WOOL.id, 14)
 
Search WWH ::




Custom Search