Package com.sk89q.craftbook.util

Examples of com.sk89q.craftbook.util.Vector


     */
    private void clearRow(Vector origin, Vector change, int type, int dist, BlockBag bag)
            throws BlockBagException {

        for (int i = 1; i <= dist; i++) {
            Vector p = origin.add(change.multiply(i));
            int t = world.getId(p);
            if (t == type) {
                bag.setBlockID(world, p, 0);
            } else if (t != 0) {
                break;
View Full Code Here


     */
    private void setRow(Vector origin, Vector change, int type, int dist, BlockBag bag)
            throws BlockBagException {

        for (int i = 1; i <= dist; i++) {
            Vector p = origin.add(change.multiply(i));
            int t = world.getId(p);
            if (canPassThrough(t)) {
                bag.setBlockID(world, p, type);
            } else if (t != type) {
                break;
View Full Code Here

                        && (!BlockType.isRedstoneBlock(westSideAbove) || westSide == 0)
                        && (!BlockType.isRedstoneBlock(eastSideAbove) || eastSide == 0)
                        && (!BlockType.isRedstoneBlock(westSideBelow) || westSide != 0)
                        && (!BlockType.isRedstoneBlock(eastSideBelow) || eastSide != 0)) {
                    // Possible blocks north / south
                    handleDirectWireInput(new Vector(x - 1, y, z), isOn, v);
                    handleDirectWireInput(new Vector(x + 1, y, z), isOn, v);
                    handleDirectWireInput(new Vector(x - 1, y - 1, z), isOn, v);
                    handleDirectWireInput(new Vector(x + 1, y - 1, z), isOn, v);
                }

                if (!BlockType.isRedstoneBlock(northSide)
                        && !BlockType.isRedstoneBlock(southSide)
                        && (!BlockType.isRedstoneBlock(northSideAbove) || northSide == 0)
                        && (!BlockType.isRedstoneBlock(southSideAbove) || southSide == 0)
                        && (!BlockType.isRedstoneBlock(northSideBelow) || northSide != 0)
                        && (!BlockType.isRedstoneBlock(southSideBelow) || southSide != 0)) {
                    // Possible blocks west / east
                    handleDirectWireInput(new Vector(x, y, z - 1), isOn, v);
                    handleDirectWireInput(new Vector(x, y, z + 1), isOn, v);
                    handleDirectWireInput(new Vector(x, y - 1, z - 1), isOn, v);
                    handleDirectWireInput(new Vector(x, y - 1, z + 1), isOn, v);
                }

                // Can be triggered from below
                handleDirectWireInput(new Vector(x, y + 1, z), isOn, v);

                return newLevel;
            }

            // For redstone wires, the code already exited this method
            // Non-wire blocks proceed

            handleDirectWireInput(new Vector(x - 1, y, z), isOn, v);
            handleDirectWireInput(new Vector(x + 1, y, z), isOn, v);
            handleDirectWireInput(new Vector(x - 1, y - 1, z), isOn, v);
            handleDirectWireInput(new Vector(x + 1, y - 1, z), isOn, v);
            handleDirectWireInput(new Vector(x, y, z - 1), isOn, v);
            handleDirectWireInput(new Vector(x, y, z + 1), isOn, v);
            handleDirectWireInput(new Vector(x, y - 1, z - 1), isOn, v);
            handleDirectWireInput(new Vector(x, y - 1, z + 1), isOn, v);

            // Can be triggered from below
            handleDirectWireInput(new Vector(x, y + 1, z), isOn, v);

            return newLevel;
        } finally {
            w.destroyFake();
        }
View Full Code Here

        //int oz = pos.getBlockZ();

        for (int x = -3; x <= 3; x++) {
            for (int y = -3; y <= 3; y++) {
                for (int z = -3; z <= 3; z++) {
                    Vector cur = pos.add(x, y, z);
                    addSingleSourcePosition(w, cur);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.sk89q.craftbook.util.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.