use of com.sk89q.worldedit.regions.Regions.asFlatRegion in project FastAsyncWorldEdit by IntellectualSites.
the class EditSession method naturalizeCuboidBlocks.
/**
* Turns the first 3 layers into dirt/grass and the bottom layers
* into rock, like a natural Minecraft mountain.
*
* @param region the region to affect
* @return number of blocks affected
* @throws MaxChangedBlocksException thrown if too many blocks are changed
*/
public int naturalizeCuboidBlocks(Region region) throws MaxChangedBlocksException {
checkNotNull(region);
Naturalizer naturalizer = new Naturalizer(this);
FlatRegion flatRegion = Regions.asFlatRegion(region);
// FAWE start - provide extent for preloading
LayerVisitor visitor = new LayerVisitor(flatRegion, minimumBlockY(region), maximumBlockY(region), naturalizer, this);
// FAWE end
Operations.completeBlindly(visitor);
return this.changes = naturalizer.getAffected();
}
Aggregations