Package com.sk89q.craftbook.util

Examples of com.sk89q.craftbook.util.Vector


     *
     * @return
     */
    private static Vector fromWE(com.sk89q.worldedit.Vector vec) {

        return new Vector(vec.getX(), vec.getY(), vec.getZ());
    }
View Full Code Here


     * @return point
     */
    @Override
    public Vector getPosition() {

        return new Vector(entity.getX(), entity.getY(), entity.getZ());
    }
View Full Code Here

        if (triggerOnRising && !chip.getIn(1).is()) {
            return;
        }

        Vector blockPos = chip.getBlockPosition();

        int x = blockPos.getBlockX();
        int y = blockPos.getBlockY();
        int z = blockPos.getBlockZ();

        try {
            String yOffsetLine = chip.getText().getLine3();

            if (yOffsetLine.length() > 0) {
View Full Code Here

        if (chip.getIn(1).is()) {
            String id = chip.getText().getLine3();
            String rider = chip.getText().getLine4();

            if (c.isValidMob(id)) {
                Vector pos = chip.getBlockPosition();
                int maxY = Math.min(128, pos.getBlockY() + 10);
                int x = pos.getBlockX();
                int z = pos.getBlockZ();

                for (int y = pos.getBlockY() + 1; y <= maxY; y++) {
                    if (BlockType.canPassThrough(world.getId(x, y, z))) {
                        if (rider.length() != 0 && c.isValidMob(rider)) {
                            world.spawnMob(x, y, z, id, rider);
                        } else {
                            world.spawnMob(x, y, z, id);
View Full Code Here

     * @param vertVel
     */
    protected void shoot(ChipState chip, float speed, float spread, float vertVel) {

        for (int i = 0; i < 5; i++) {
            Vector backDir = chip.getBlockPosition().subtract(
                    chip.getPosition());
            Vector firePos = chip.getBlockPosition().add(backDir);
            chip.getWorld().shootArrow(firePos.getBlockX() + 0.5, firePos.getBlockY() + 0.5, firePos.getBlockZ() + 0.5,
                    backDir.getBlockX(), vertVel, backDir.getBlockZ(),
                    speed, spread);
        }
    }
View Full Code Here

        }

        int item = CraftBookUtil.getItem(chip.getServer().getConfiguration(), id);

        if (item > 0 && !(item >= 21 && item <= 34) && item != 36) {
            Vector pos = chip.getBlockPosition();
            int maxY = Math.min(128, pos.getBlockY() + 10);
            int x = pos.getBlockX();
            int z = pos.getBlockZ();

            for (int y = pos.getBlockY() + 1; y <= maxY; y++) {
                if (BlockType.canPassThrough(chip.getWorld().getId(x, y, z))) {
                    int n = 0;
                    for (n = 0; n < quantity; n++) {
                        try {
                            source.fetchBlock(item);
View Full Code Here

     * @param spread
     * @param vertVel
     */
    protected void shoot(ChipState chip, float speed, float spread, float vertVel) {

        Vector backDir = chip.getBlockPosition().subtract(
                chip.getPosition());
        Vector firePos = chip.getBlockPosition().add(backDir);
        chip.getWorld().shootArrow(firePos.getBlockX() + 0.5, firePos.getBlockY() + 0.5, firePos.getBlockZ() + 0.5,
                backDir.getBlockX(), vertVel, backDir.getBlockZ(),
                speed, spread);
    }
View Full Code Here

        if (triggerOnRising && !chip.getIn(1).is()) {
            return;
        }

        Vector blockPos = chip.getBlockPosition();

        int x = blockPos.getBlockX();
        int y = blockPos.getBlockY();
        int z = blockPos.getBlockZ();

        try {
            String yOffsetLine = chip.getText().getLine3();

            if (yOffsetLine.length() > 0) {
View Full Code Here

        int item = CraftBookUtil.getItem(chip.getServer().getConfiguration(), id);

        if ((item > 0 || isForced) && !(item >= 21 && item <= 34)
                && item != 36) {
            Vector pos = chip.getBlockPosition();
            int y = pos.getBlockY() - 2;
            int x = pos.getBlockX();
            int z = pos.getBlockZ();

            if (y >= 0 && (isForced || chip.getWorld().getId(x, y, z) == 0)) {
                chip.getWorld().setId(x, y, z, item);
                chip.getOut(1).set(true);
            } else {
View Full Code Here

        if (type == BlockType.STONE) {
            return;
        }

        // Must have a lava floor
        Vector lavaPos = pt.subtract(0, pt.getBlockY() - minY + 1, 0);
        if (!BlockType.isLava(world.getId(lavaPos))) {
            throw new NotACauldronException("Cauldron lacks lava below");
        }

        // Now we recurse!
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.