Package com.sk89q.worldedit

Examples of com.sk89q.worldedit.Vector


        return editSession.getBlockType(new Vector(x, y, z));
    }

    @Override
    public int getBlockDataAbs(double x, double y, double z) {
        return editSession.getBlockData(new Vector(x, y, z));
    }
View Full Code Here


    public FlatRegionIterator(Region region) {
        checkNotNull(region);

        this.region = region;

        Vector min = region.getMinimumPoint();
        Vector max = region.getMaximumPoint();

        this.y = min.getBlockY();

        this.minX = min.getBlockX();

        this.nextX = minX;
        this.nextZ = min.getBlockZ();

        this.maxX = max.getBlockX();
        this.maxZ = max.getBlockZ();

        forward();
    }
View Full Code Here

    public boolean hasNext() {
        return nextX != Integer.MIN_VALUE;
    }

    private void forward() {
        while (hasNext() && !region.contains(new Vector(nextX, y, nextZ))) {
            forwardOne();
        }
    }
View Full Code Here

        this.offset = offset;
    }

    @Override
    public BaseBlock apply(Vector position) {
        Vector base = position.add(offset);
        Vector size = extent.getMaximumPoint().subtract(extent.getMinimumPoint()).add(1, 1, 1);
        int x = base.getBlockX() % size.getBlockX();
        int y = base.getBlockY() % size.getBlockY();
        int z = base.getBlockZ() % size.getBlockZ();
        return extent.getBlock(new Vector(x, y, z));
    }
View Full Code Here

        if (alwaysGlass || !player.getAllowFlight()) {
            super.floatAt(x, y, z, alwaysGlass);
            return;
        }

        setPosition(new Vector(x + 0.5, y, z + 0.5));
        player.setFlying(true);
    }
View Full Code Here

    }

    @Override
    public com.sk89q.worldedit.util.Location getLocation() {
        Location nativeLocation = player.getLocation();
        Vector position = BukkitUtil.toVector(nativeLocation);
        return new com.sk89q.worldedit.util.Location(
                getWorld(),
                position,
                nativeLocation.getYaw(),
                nativeLocation.getPitch());
View Full Code Here

            perlin.setOctaveCount((int) octaves.getValue());
            perlin.setPersistence(persistence.getValue());
        } catch (IllegalArgumentException e) {
            throw new EvaluationException(0, "Perlin noise error: " + e.getMessage());
        }
        return perlin.noise(new Vector(x.getValue(), y.getValue(), z.getValue()));
    }
View Full Code Here

            voronoi.setSeed((int) seed.getValue());
            voronoi.setFrequency(frequency.getValue());
        } catch (IllegalArgumentException e) {
            throw new EvaluationException(0, "Voronoi error: " + e.getMessage());
        }
        return voronoi.noise(new Vector(x.getValue(), y.getValue(), z.getValue()));
    }
View Full Code Here

            ridgedMulti.setFrequency(frequency.getValue());
            ridgedMulti.setOctaveCount((int) octaves.getValue());
        } catch (IllegalArgumentException e) {
            throw new EvaluationException(0, "Ridged multi error: " + e.getMessage());
        }
        return ridgedMulti.noise(new Vector(x.getValue(), y.getValue(), z.getValue()));
    }
View Full Code Here

     * Find needed chunks in the axis-aligned bounding box of the region.
     *
     * @param region The {@link Region} to iterate
     */
    private void findNeededCuboidChunks(Region region) {
        Vector min = region.getMinimumPoint();
        Vector max = region.getMaximumPoint();

        // First, we need to group points by chunk so that we only need
        // to keep one chunk in memory at any given moment
        for (int x = min.getBlockX(); x <= max.getBlockX(); ++x) {
            for (int y = min.getBlockY(); y <= max.getBlockY(); ++y) {
                for (int z = min.getBlockZ(); z <= max.getBlockZ(); ++z) {
                    Vector pos = new Vector(x, y, z);
                    checkAndAddBlock(pos);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.Vector

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.