Package org.spout.api.geo.cuboid

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


    for (BlockFace face : BlockFaces.NESW) {
      Block frame = origin.translate(face, 2);
      BlockFace facing = face.getOpposite();
      // Place the three pieces
      placeFrame(frame, facing);
      placeFrame(frame.translate(BlockFaces.NESW.previous(face)), facing);
      placeFrame(frame.translate(BlockFaces.NESW.next(face)), facing);
    }

    // Set to a random state
    setRandomActive(origin, 0.1f);
View Full Code Here


      Block frame = origin.translate(face, 2);
      BlockFace facing = face.getOpposite();
      // Place the three pieces
      placeFrame(frame, facing);
      placeFrame(frame.translate(BlockFaces.NESW.previous(face)), facing);
      placeFrame(frame.translate(BlockFaces.NESW.next(face)), facing);
    }

    // Set to a random state
    setRandomActive(origin, 0.1f);
  }
View Full Code Here

              } else {
                top = VanillaMaterials.GRASS;
              }
              block.setMaterial(top);
            } else if (material == VanillaMaterials.STATIONARY_WATER
                && block.translate(0, 1, 0).isMaterial(VanillaMaterials.AIR)) {
              if (block.getBiomeType() instanceof SnowyBiome) {
                block.setMaterial(VanillaMaterials.ICE);
              }
            }
          }
View Full Code Here

    }
    for (int xx = x - 2; xx < x + 3; xx++) {
      for (int zz = z - 2; zz < z + 3; zz++) {
        final Block block = w.getBlock(xx, y - 1, zz);
        if (!overridable.contains(block.getMaterial())
            || !overridable.contains(block.translate(BlockFace.BOTTOM).getMaterial())) {
          return false;
        }
      }
    }
    return true;
View Full Code Here

    int expectHeight = b.getDataField(heightMask);
    for (int i = 0; i < expectHeight + 1; i++) {
      if (!(trunk.getMaterial() instanceof Log)) {
        return;
      }
      trunk = trunk.translate(BlockFace.TOP);
    }
    Material trunkMaterial = trunk.getMaterial();
    if (expectHeight == 3) {
      trunk = b;
      for (int i = 0; i < expectHeight + 1; i++) {
View Full Code Here

      }
    } else if (item.getMaterial() instanceof BoatItem) {
      Point placePos;
      if (facingBlock.getMaterial() instanceof Water) {
        placePos = facingBlock.getPosition().add(.5f, 1f, .5f);
      } else if (facingBlock.getMaterial().equals(VanillaMaterials.AIR) && facingBlock.translate(BlockFace.BOTTOM).getMaterial() instanceof Water) {
        placePos = facingBlock.getPosition().add(.5f, 0f, .5f);
      } else {
        return false;
      }
      Boat boat = ((BoatItem) item.getMaterial()).spawnEntity(placePos);
View Full Code Here

    Material trunkMaterial = trunk.getMaterial();
    if (expectHeight == 3) {
      trunk = b;
      for (int i = 0; i < expectHeight + 1; i++) {
        trunk.setMaterial(BlockMaterial.AIR);
        trunk = trunk.translate(BlockFace.TOP);
      }
      sapling.growTree(b, sapling);
      return;
    }
View Full Code Here

      return;
    }

    if (trunkMaterial == BlockMaterial.AIR || trunkMaterial instanceof Leaves) {
      trunk.setMaterial(b.getMaterial());
      trunk = trunk.translate(BlockFace.TOP);
      if (trunk.getMaterial() == BlockMaterial.AIR) {
        trunk.setMaterial(Leaves.DEFAULT);
        trunk.setData(data & dataMask);
      }
      b.setDataField(heightMask, expectHeight + 1);
View Full Code Here

    // See if it's touching water
    boolean breakBlocks = true;
    if (!ignoreWater) {
      Block block = position.getBlock();
      for (BlockFace face : BlockFaces.NESWBT) {
        if (block.translate(face).isMaterial(VanillaMaterials.WATER)) {
          breakBlocks = false;
          break;
        }
      }
    }
View Full Code Here

            held.addData(1);
          }
        }

        // Handle the creation of portals
        Point pos = target.translate(BlockFace.BOTTOM).getPosition();
        VanillaObjects.NETHER_PORTAL.setActive(pos.getWorld(), pos.getBlockX(), pos.getBlockY(), pos.getBlockZ(), true);
      }
    }
  }
}
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.