Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. def createTestBoard(self, anyBlock=True):
  2. if anyBlock:
  3. allBlocks = [self.editor.level.materials[a, b] for a in range(256) for b in range(16)]
  4. blockWidth = 64
  5. else:
  6. allBlocks = self.editor.level.materials.allBlocks
  7. blockWidth = 16
  8. blockCount = len(allBlocks)
  9.  
  10. width = blockWidth * 3 + 1
  11. rows = blockCount // blockWidth + 1
  12. length = rows * 3 + 1
  13. height = 3
  14.  
  15. schematic = pymclevel.MCSchematic((width, height, length), mats=self.editor.level.materials)
  16. schematic.Blocks[:, :, 0] = 1
  17.  
  18. for i, block in enumerate(allBlocks):
  19. col = (i % blockWidth) * 3 + 1
  20. row = (i // blockWidth) * 3
  21. schematic.Blocks[col:col + 2, row:row + 2, 2] = block.ID
  22. schematic.Data[col:col + 2, row:row + 2, 2] = block.blockData
  23.  
  24. return schematic
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement