broadcastLocation = metaYaml.getBoolean(tagBroadcastLocation, broadcastLocation);
decayable = metaYaml.getBoolean(tagDecayable, decayable);
}
// load the actual blocks
CuboidClipboard cuboid = SchematicFormat.getFormat(file).load(file);
// how big is it?
sizeX = cuboid.getWidth();
sizeZ = cuboid.getLength();
sizeY = cuboid.getHeight();
//TODO Validate the size
// try and save the meta data if we can
try {
metaYaml.save(metaFile);
} catch (IOException e) {
// we can recover from this... so eat it!
generator.reportException("[WorldEdit] Could not resave " + metaFile.getAbsolutePath(), e);
}
// grab the edge block
BaseBlock edge = cuboid.getBlock(new Vector(0, groundLevelY, 0));
edgeType = edge.getType();
edgeData = edge.getData();
edgeRise = BlackMagic.getMaterialId(generator.oreProvider.surfaceMaterial) == edgeType ? 0 : 1;
// allocate the blocks
facingCount = 1;
if (flipableX)
facingCount *= 2;
if (flipableZ)
facingCount *= 2;
//TODO we should allocate only facing count, then allocate the size based on what comes out of the rotation.. once I do rotation
// allocate room
blocks = new BaseBlock[facingCount][sizeX][sizeY][sizeZ];
// copy the cubes for each direction
copyCuboid(cuboid, 0); // normal one
if (flipableX) {
cuboid.flip(FlipDirection.WEST_EAST);
copyCuboid(cuboid, 1);
// z too? if so then make two more copies
if (flipableZ) {
cuboid.flip(FlipDirection.NORTH_SOUTH);
copyCuboid(cuboid, 3);
cuboid.flip(FlipDirection.WEST_EAST);
copyCuboid(cuboid, 2);
}
// just z
} else if (flipableZ) {
cuboid.flip(FlipDirection.NORTH_SOUTH);
copyCuboid(cuboid, 1);
}
}