Package com.sk89q.worldedit.regions

Examples of com.sk89q.worldedit.regions.Polygonal2DRegion


     * Create a new selector with the given world.
     *
     * @param world the world
     */
    public Polygonal2DRegionSelector(@Nullable World world) {
        region = new Polygonal2DRegion(world);
    }
View Full Code Here


        if (oldSelector instanceof Polygonal2DRegionSelector) {
            final Polygonal2DRegionSelector polygonal2DRegionSelector = (Polygonal2DRegionSelector) oldSelector;

            pos1 = polygonal2DRegionSelector.pos1;
            region = new Polygonal2DRegion(polygonal2DRegionSelector.region);
        } else {
            final Region oldRegion;
            try {
                oldRegion = oldSelector.getRegion();
            } catch (IncompleteRegionException e) {
                return;
            }

            final int minY = oldRegion.getMinimumPoint().getBlockY();
            final int maxY = oldRegion.getMaximumPoint().getBlockY();

            List<BlockVector2D> points = oldRegion.polygonize(Integer.MAX_VALUE);

            pos1 = points.get(0).toVector(minY).toBlockVector();
            region = new Polygonal2DRegion(oldRegion.getWorld(), points, minY, maxY);
        }
    }
View Full Code Here

    public Polygonal2DRegionSelector(@Nullable World world, List<BlockVector2D> points, int minY, int maxY) {
        checkNotNull(points);
       
        final BlockVector2D pos2D = points.get(0);
        pos1 = new BlockVector(pos2D.getX(), minY, pos2D.getZ());
        region = new Polygonal2DRegion(world, points, minY, maxY);
    }
View Full Code Here

        if (position.equals(pos1)) {
            return false;
        }

        pos1 = position.toBlockVector();
        region = new Polygonal2DRegion(region.getWorld());
        region.addPoint(position);
        region.expandY(position.getBlockY());

        return true;
    }
View Full Code Here

    }

    @Override
    public void clear() {
        pos1 = null;
        region = new Polygonal2DRegion(region.getWorld());
    }
View Full Code Here

                points[1] = fepos2;
                return points;
            }
            else if (region instanceof Polygonal2DRegion)
            {
                Polygonal2DRegion polygon = (Polygonal2DRegion) region;
                Point fepos1 = new Point(polygon.getMinimumPoint().getBlockX(), polygon.getMinimumPoint().getBlockY(), polygon.getMinimumPoint().getBlockZ());
                Point fepos2 = new Point(polygon.getMaximumPoint().getBlockX(), polygon.getMaximumPoint().getBlockY(), polygon.getMaximumPoint().getBlockZ());
                points[0] = fepos1;
                points[1] = fepos2;
                return points;
            }
            else
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.regions.Polygonal2DRegion

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.