Added non-cuboid support for //walls and //outline.

This commit is contained in:
TomyLobo
2013-11-01 19:05:49 +01:00
parent 6e3d8395df
commit 961773ce5d
4 changed files with 98 additions and 19 deletions

View File

@ -47,6 +47,7 @@ import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionOperationException;
import com.sk89q.worldedit.shape.ArbitraryShape;
import com.sk89q.worldedit.shape.RegionShape;
import com.sk89q.worldedit.shape.WorldEditExpressionEnvironment;
import com.sk89q.worldedit.util.TreeGenerator;
@ -1527,6 +1528,19 @@ public class EditSession {
return affected;
}
/**
* Make faces of the region
*
* @param region
* @param pattern
* @return number of blocks affected
* @throws MaxChangedBlocksException
*/
public int makeFaces(final Region region, Pattern pattern) throws MaxChangedBlocksException {
return new RegionShape(region).generate(this, pattern, true);
}
/**
* Make walls of the region (as if it was a cuboid if it's not).
*
@ -1627,6 +1641,18 @@ public class EditSession {
return affected;
}
/**
* Make walls of the region
*
* @param region
* @param pattern
* @return number of blocks affected
* @throws MaxChangedBlocksException
*/
public int makeWalls(final Region region, Pattern pattern) throws MaxChangedBlocksException {
return new RegionShape(region).generate(this, pattern, true, true);
}
/**
* Overlays a layer of blocks over a cuboid area.
*