Package org.spout.api.geo.cuboid

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


      if (target.translate(BlockFace.BOTTOM).isMaterial(this)) {
        return true;
      }
    }
    //check above
    if (target.translate(BlockFace.TOP).isMaterial(this)) {
      if (!RedstoneUtil.isConductor(block.translate(BlockFace.TOP))) {
        return true;
      }
    }
    return false;
View Full Code Here


    MinecartTrackLogic logic;
    logic = create(block);
    if (logic != null) {
      return logic;
    }
    logic = create(block.translate(BlockFace.TOP));
    if (logic != null) {
      return logic;
    }
    logic = create(block.translate(BlockFace.BOTTOM));
    return logic;
View Full Code Here

    }
    logic = create(block.translate(BlockFace.TOP));
    if (logic != null) {
      return logic;
    }
    logic = create(block.translate(BlockFace.BOTTOM));
    return logic;
  }

  public boolean setDirection(BlockFace dir1, BlockFace dir2) {
    return this.setState(RailsState.get(dir1, dir2));
View Full Code Here

      if (isFullyGrown(block)) {
        for (int i = 0; i < BlockFaces.NESW.size(); i++) {
          Block spread = block.translate(BlockFaces.NESW.get(i));
          BlockMaterial material = spread.getMaterial();
          if (material == VanillaMaterials.AIR) {
            BlockMaterial belowSpread = spread.translate(BlockFace.BOTTOM).getMaterial();
            if (belowSpread.isMaterial(VanillaMaterials.FARMLAND, VanillaMaterials.DIRT, VanillaMaterials.GRASS)) {
              spread.setMaterial(this.getLastStageMaterial());
              break;
            }
          } else if (material == getLastStageMaterial()) {
View Full Code Here

      while (iterator.hasNext()) {
        Block block = iterator.next();
        if (!(block.getMaterial() instanceof Water)) {
          continue;
        }
        block = block.translate(BlockFace.TOP);
        Cause<Entity> cause;
        if (entity instanceof Player) {
          cause = new PlayerBreakCause((Player) entity, block);
        } else {
          cause = new EntityCause(entity);
View Full Code Here

    // Rotates the facing 90 degrees to the left
    BlockFace lookDirection = BlockFaces.NESW.previous(facing);
    // Get the corner piece
    Block corner = frameBlock;
    for (int i = 0; i < 4 && isEndFrame(corner, facing, false); i++) {
      corner = corner.translate(lookDirection);
    }
    // Now go two steps back and two steps towards the middle (facing)
    return corner.translate(lookDirection, -2).translate(facing, 2);
  }
View Full Code Here

    Block corner = frameBlock;
    for (int i = 0; i < 4 && isEndFrame(corner, facing, false); i++) {
      corner = corner.translate(lookDirection);
    }
    // Now go two steps back and two steps towards the middle (facing)
    return corner.translate(lookDirection, -2).translate(facing, 2);
  }

  private boolean findFrame(Block origin, boolean withEnderEye) {
    for (BlockFace face : BlockFaces.NESW) {
      Block frame = origin.translate(face, 2);
View Full Code Here

      Block frame = origin.translate(face, 2);
      BlockFace facing = face.getOpposite();
      if (!isEndFrame(frame, facing, withEnderEye)) {
        return false;
      }
      if (!isEndFrame(frame.translate(BlockFaces.NESW.previous(face)), facing, withEnderEye)) {
        return false;
      }
      if (!isEndFrame(frame.translate(BlockFaces.NESW.next(face)), facing, withEnderEye)) {
        return false;
      }
View Full Code Here

        return false;
      }
      if (!isEndFrame(frame.translate(BlockFaces.NESW.previous(face)), facing, withEnderEye)) {
        return false;
      }
      if (!isEndFrame(frame.translate(BlockFaces.NESW.next(face)), facing, withEnderEye)) {
        return false;
      }
    }
    return true;
  }
View Full Code Here

        if (!middle.getMaterial().isMaterial(VanillaMaterials.AIR)) {
          continue;
        }
        byte adjacentSolidBlockCount = 0;
        for (final BlockFace face : BlockFaces.NESW) {
          if (middle.translate(face).getMaterial().isOpaque()) {
            adjacentSolidBlockCount++;
          }
        }
        if (adjacentSolidBlockCount != 1) {
          continue;
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.