Package com.sk89q.worldedit

Examples of com.sk89q.worldedit.BlockVector


    @Override
    public BlockVector next() {
        if (!hasNext()) throw new java.util.NoSuchElementException();

        BlockVector answer = new BlockVector(nextX, nextY, nextZ);

        forwardOne();
        forward();

        return answer;
View Full Code Here


    public BlockVector next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }

        BlockVector current = new BlockVector(next2D.getBlockX(), nextY, next2D.getBlockZ());
        if (nextY < maxY) {
            nextY++;
        } else if (flatIterator.hasNext()) {
            next2D = flatIterator.next();
            nextY = minY;
View Full Code Here

  /* (non-Javadoc)
   * @see de.beimax.simplespleef.util.Cuboid#setSerializedBlocks(de.beimax.simplespleef.util.SerializableBlockData[][][])
   */
  @Override
  public void setSerializedBlocks(SerializableBlockData[][][] blockData) {
    BlockVector max = region.getMaximumPoint();
    BlockVector min = region.getMinimumPoint();

    LinkedList<Chunk> chunksChanged = new LinkedList<Chunk>();

    final int[] coords = {(min.getBlockX()<max.getBlockX()?min.getBlockX():max.getBlockX()),
        (min.getBlockY()<max.getBlockY()?min.getBlockY():max.getBlockY()),
        (min.getBlockZ()<max.getBlockZ()?min.getBlockZ():max.getBlockZ())};

    for (int x = 0; x < blockData.length; x++)
      for (int y = 0; y < blockData[0].length; y++)
        for (int z = 0; z < blockData[0][0].length; z++) {
          if (this.region.contains(coords[0] + x, coords[1] + y, coords[2] + z)) { // only restore, if within the region
View Full Code Here

    return new Location(this.world, coords[3], coords[4], coords[5]);
  }

  @Override
  public final int[] getMinMaxCoords() {
    BlockVector max = region.getMaximumPoint();
    BlockVector min = region.getMinimumPoint();
   
    final int[] coords = {(min.getBlockX()<max.getBlockX()?min.getBlockX():max.getBlockX()),
        (min.getBlockY()<max.getBlockY()?min.getBlockY():max.getBlockY()),
        (min.getBlockZ()<max.getBlockZ()?min.getBlockZ():max.getBlockZ()),
        (min.getBlockX()>max.getBlockX()?min.getBlockX():max.getBlockX()),
        (min.getBlockY()>max.getBlockY()?min.getBlockY():max.getBlockY()),
        (min.getBlockZ()>max.getBlockZ()?min.getBlockZ():max.getBlockZ())};
    return coords;
  }
View Full Code Here

      return r;
    }
   
    @Override
    public Iterator<Block> getBlocks() {
      final BlockVector min = region.getMinimumPoint(), max = region.getMaximumPoint();
      return new AABB(world, new Vector(min.getBlockX(), min.getBlockY(), min.getBlockZ()), new Vector(max.getBlockX() + 1, max.getBlockY() + 1, max.getBlockZ() + 1)).iterator();
//      final Iterator<BlockVector2D> iter = region.getPoints().iterator();
//      if (!iter.hasNext())
//        return EmptyIterator.get();
//      return new Iterator<Block>() {
//        @SuppressWarnings("null")
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.BlockVector

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.