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)
def test_selection_transform(schematic_world): pytest.skip() selection = BoundingBox((10, 10, 10), (100, 100, 100)) sch_dim = schematic_world.getDimension() sch_dim_transformed = SelectionTransform(sch_dim, selection) try: from mcedit2.worldview.schematic_worldview import displaySchematic except ImportError: log.warn("mcedit2 not available, not displaying result") else: displaySchematic(sch_dim_transformed)
def test_rotation_transform(pc_world, schematic_world): pytest.skip() sch_dim = schematic_world.getDimension() sch_dim_transformed = DimensionTransform(sch_dim, sch_dim.bounds.center, 0., 0., 45.) assert sch_dim_transformed.chunkCount() <= 2 * sch_dim.chunkCount() try: from mcedit2.worldview.schematic_worldview import displaySchematic except ImportError: log.warn("mcedit2 not available, not displaying result") else: displaySchematic(sch_dim_transformed)