Create testbed schematic with all block types

This commit is contained in:
David Vierra 2016-05-31 18:48:02 -10:00
parent 1c5d244b47
commit 36e58fc899
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,42 @@
"""
create_testbed
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import numpy
from mcedit2.worldview.schematic_worldview import displaySchematic
from mceditlib.schematic import SchematicFileAdapter, createSchematic
from mceditlib.worldeditor import WorldEditor
log = logging.getLogger(__name__)
def main():
blockWidth = 64
blockCount = 256*16
width = blockWidth * 3 + 1
rows = blockCount // blockWidth + 1
length = rows * 3 + 1
height = 3
world = createSchematic((width, height, length))
dim = world.getDimension()
allBlocks = [world.blocktypes[a, b] for a in range(256) for b in range(16)]
w, l = numpy.indices((width, length))
dim.setBlocks(w, 1, l, "minecraft:stone")
for i, block in enumerate(allBlocks):
col = (i % blockWidth) * 3 + 1
row = (i // blockWidth) * 3
dim.setBlocks([col, col+1, col, col+1], 2, [row, row, row+1, row+1], block)
world.saveToFile("testbed.schematic")
displaySchematic(dim)
if __name__ == '__main__':
main()

Binary file not shown.