@Override public CuboidRegion getRegion() throws IncompleteRegionException { if (position1 == null || position2 == null) { throw new IncompleteRegionException(); } return region; }
} catch (IncompleteRegionException e) { e.printStackTrace(); return null;
@Override public BlockVector3 getPrimaryPosition() throws IncompleteRegionException { if (pos1 == null) { throw new IncompleteRegionException(); } return pos1; }
@Override public BlockVector3 getPrimaryPosition() throws IncompleteRegionException { if (position1 == null) { throw new IncompleteRegionException(); } return position1; }
@Override public EllipsoidRegion getRegion() throws IncompleteRegionException { if (!isDefined()) { throw new IncompleteRegionException(); } return region; }
@Override public CylinderRegion getRegion() throws IncompleteRegionException { if (!isDefined()) { throw new IncompleteRegionException(); } return region; }
@Override public Region getRegion() throws IncompleteRegionException { if (!region.isDefined()) { throw new IncompleteRegionException(); } return region; }
@Override public Polygonal2DRegion getRegion() throws IncompleteRegionException { if (!isDefined()) { throw new IncompleteRegionException(); } return region; }
@Override public BlockVector3 getPrimaryPosition() throws IncompleteRegionException { if (!isDefined()) { throw new IncompleteRegionException(); } return region.getCenter().toBlockPoint(); }
/** * Get the selection region. If you change the region, you should * call learnRegionChanges(). If the selection is defined in * a different world, the {@code IncompleteRegionException} * exception will be thrown. * * @param world the world * @return a region * @throws IncompleteRegionException if no region is selected */ public Region getSelection(World world) throws IncompleteRegionException { checkNotNull(world); if (selector.getIncompleteRegion().getWorld() == null || !selector.getIncompleteRegion().getWorld().equals(world)) { throw new IncompleteRegionException(); } return selector.getRegion(); }