Package org.spout.api.geo.cuboid

Examples of org.spout.api.geo.cuboid.Block.translate()


    }

    // Build horizontal columns
    for (int dw = 0; dw < 3; dw++) {
      bottomLeftBlock.translate(direction, dw).setMaterial(VanillaMaterials.OBSIDIAN);
      topLeftBlock.translate(direction, dw).setMaterial(VanillaMaterials.OBSIDIAN);
    }

    // Set the state of the portal
    setActive(w, x, y, z, active);
  }
View Full Code Here


  @Override
  public boolean canPlaceObject(World w, int x, int y, int z) {
    final Block block = w.getBlock(x, y, z);
    return block.isMaterial(VanillaMaterials.AIR)
        && block.translate(BlockFace.TOP).isMaterial(attachTo);
  }

  @Override
  public void placeObject(World w, int x, int y, int z) {
    final Vector3f seed = new Vector3f(x, y, z);
View Full Code Here

        }
        client.getLogger().info(clicked.name());
        client.getScheduler().safeRun(VanillaPlugin.getInstance(), new Runnable() {
          @Override
          public void run() {
            hitting.translate(clicked).setMaterial(selection);
          }
        });
      }
    }
  }
View Full Code Here

    }
  }

  public void placeDoor(int xx, int yy, int zz, DoorBlock door, BlockFace facing) {
    final Block bottom = getBlock(xx, yy, zz);
    door.create(getBlock(xx, yy, zz), bottom.translate(BlockFace.TOP),
        BlockFace.fromYaw(facing.getDirection().getAxesAngleDeg().getY() + rotation.getAxesAngleDeg().getY()), false, false);
  }

  protected Vector3f transform(int x, int y, int z) {
    return rotate(x, y, z).add(position).round();
View Full Code Here

  public BlockFace getDirection(Point pos) {
    final Block bottomLeftCorner = pos.getWorld().getBlock(pos);
    BlockFace direction = null;
    // Get the direction of the frame on horizontal axis
    for (BlockFace face : BlockFaces.NESW) {
      if (bottomLeftCorner.translate(face).isMaterial(VanillaMaterials.OBSIDIAN)) {
        if (direction != null) {
          // Two many corners
          return null;
        }
        direction = face;
View Full Code Here

    }

    // Verify the horizontal columns
    for (int d = 1; d < 3; d++) {
      if (!bottomLeftCorner.translate(direction, d).isMaterial(VanillaMaterials.OBSIDIAN)
          || !topLeftCorner.translate(direction, d).isMaterial(VanillaMaterials.OBSIDIAN)) {
        return false;
      }
    }

    return true;
View Full Code Here

    BlockFace direction = getDirection(bottomBlock.getPosition());
    Block corner1 = bottomBlock.translate(direction).translate(BlockFace.TOP);
    Block corner2 = corner1.translate(direction);
    for (int d = 0; d < 3; d++) {
      corner1.translate(BlockFace.TOP, d).setMaterial(material);
      corner2.translate(BlockFace.TOP, d).setMaterial(material);
    }
  }

  public void placeObject(World w, int x, int y, int z, BlockFace direction, boolean active) {
View Full Code Here

      if (face == BlockFace.TOP) {
        topIsConductor = RedstoneUtil.isConductor(mat);
      } else if (face != BlockFace.BOTTOM) {
        //check below for wire
        if (!RedstoneUtil.isConductor(mat)) {
          relvert = rel.translate(BlockFace.BOTTOM);
          if (relvert.getMaterial().equals(this)) {
            maxPower = (short) Math.max(maxPower, this.getRedstonePower(relvert) - 1);
          }
        }
        //check above for wire
View Full Code Here

            maxPower = (short) Math.max(maxPower, this.getRedstonePower(relvert) - 1);
          }
        }
        //check above for wire
        if (!topIsConductor) {
          relvert = rel.translate(BlockFace.TOP);
          if (relvert.getMaterial().equals(this)) {
            maxPower = (short) Math.max(maxPower, this.getRedstonePower(relvert) - 1);
          }
        }
      }
View Full Code Here

    if (mat instanceof RedstoneSource) {
      return true;
    }
    //check below
    if (!RedstoneUtil.isConductor(mat)) {
      if (target.translate(BlockFace.BOTTOM).isMaterial(this)) {
        return true;
      }
    }
    //check above
    if (target.translate(BlockFace.TOP).isMaterial(this)) {
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.