use of com.sk89q.worldedit.regions.RegionOperationException in project FastAsyncWorldEdit by IntellectualSites.
the class ExpandCommands method expandVert.
private static void expandVert(LocalSession session, Actor actor, World world) throws IncompleteRegionException {
Region region = session.getSelection(world);
int height = world.getMaxY() - world.getMinY();
try {
long oldSize = region.getVolume();
region.expand(BlockVector3.at(0, height, 0), BlockVector3.at(0, -height, 0));
session.getRegionSelector(world).learnChanges();
long newSize = region.getVolume();
session.getRegionSelector(world).explainRegionAdjust(actor, session);
long changeSize = newSize - oldSize;
actor.print(Caption.of("worldedit.expand.expanded.vert", TextComponent.of(changeSize)));
} catch (RegionOperationException e) {
actor.printError(TextComponent.of(e.getMessage()));
}
}
Aggregations