Examples of BlockVector


Examples of com.sk89q.worldedit.BlockVector

            max = location;
        } else {
            max = Vector.getMaximum(max, location);
        }

        BlockVector blockVector = location.toBlockVector();
        if (mask.test(blockVector)) {
            buffer.put(blockVector, block);
            return true;
        } else {
            return getExtent().setBlock(location, block);
View Full Code Here

Examples of com.sk89q.worldedit.BlockVector

     * method will do nothing.</p>
     *
     * @param position the position
     */
    public void visit(Vector position) {
        BlockVector blockVector = position.toBlockVector();
        if (!visited.contains(blockVector)) {
            queue.add(blockVector);
            visited.add(blockVector);
        }
    }
View Full Code Here

Examples of com.sk89q.worldedit.BlockVector

     *
     * @param from the origin block
     * @param to the block under question
     */
    private void visit(Vector from, Vector to) {
        BlockVector blockVector = to.toBlockVector();
        if (!visited.contains(blockVector)) {
            visited.add(blockVector);
            if (isVisitable(from, to)) {
                queue.add(blockVector);
            }
View Full Code Here

Examples of com.sk89q.worldedit.BlockVector

                return it.hasNext();
            }

            @Override
            public BlockVector next() {
                BlockVector next = it.next();
                if (next != null) {
                    return transform.apply(next).toBlockVector();
                } else {
                    return null;
                }
View Full Code Here

Examples of com.sk89q.worldedit.BlockVector

                }

                values.put(entry.getKey(), entry.getValue());
            }

            BlockVector vec = new BlockVector(x, y, z);
            tileEntitiesMap.put(vec, values);
        }

        BlockArrayClipboard clipboard = new BlockArrayClipboard(region);
        clipboard.setOrigin(origin);

        // Don't log a torrent of errors
        int failedBlockSets = 0;

        for (int x = 0; x < width; ++x) {
            for (int y = 0; y < height; ++y) {
                for (int z = 0; z < length; ++z) {
                    int index = y * width * length + z * width + x;
                    BlockVector pt = new BlockVector(x, y, z);
                    BaseBlock block = new BaseBlock(blocks[index], blockData[index]);

                    if (tileEntitiesMap.containsKey(pt)) {
                        block.setNbtData(new CompoundTag(tileEntitiesMap.get(pt)));
                    }
View Full Code Here

Examples of com.sk89q.worldedit.BlockVector

                }

                values.put(entry.getKey(), entry.getValue());
            }

            BlockVector vec = new BlockVector(x, y, z);
            tileEntitiesMap.put(vec, values);
        }

        Vector size = new Vector(width, height, length);
        CuboidClipboard clipboard = new CuboidClipboard(size);
        clipboard.setOrigin(origin);
        clipboard.setOffset(offset);

        for (int x = 0; x < width; ++x) {
            for (int y = 0; y < height; ++y) {
                for (int z = 0; z < length; ++z) {
                    int index = y * width * length + z * width + x;
                    BlockVector pt = new BlockVector(x, y, z);
                    BaseBlock block = getBlockForId(blocks[index], blockData[index]);

                    if (tileEntitiesMap.containsKey(pt)) {
                        block.setNbtData(new CompoundTag(tileEntitiesMap.get(pt)));
                    }
View Full Code Here

Examples of com.sk89q.worldedit.BlockVector

        for (int x = 0; x < width; ++x) {
            for (int y = 0; y < height; ++y) {
                for (int z = 0; z < length; ++z) {
                    int index = y * width * length + z * width + x;
                    BaseBlock block = clipboard.getPoint(new BlockVector(x, y, z));

                    // Save 4096 IDs in an AddBlocks section
                    if (block.getType() > 255) {
                        if (addBlocks == null) { // Lazily create section
                            addBlocks = new byte[(blocks.length >> 1) + 1];
View Full Code Here

Examples of com.sk89q.worldedit.BlockVector

                }

                values.put(entry.getKey(), entry.getValue());
            }

            BlockVector vec = new BlockVector(x, y, z);
            tileEntities.put(vec, values);
        }
    }
View Full Code Here

Examples of com.sk89q.worldedit.BlockVector

    private CompoundTag getBlockTileEntity(Vector position) throws DataException {
        if (tileEntities == null) {
            populateTileEntities();
        }

        Map<String, Tag> values = tileEntities.get(new BlockVector(position));
        if (values == null) {
            return null;
        }

        return new CompoundTag(values);
View Full Code Here

Examples of com.sk89q.worldedit.BlockVector

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

    private void forward() {
        while (hasNext() && !region.contains(new BlockVector(nextX, nextY, nextZ))) {
            forwardOne();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.