Package buildcraft.api.core

Examples of buildcraft.api.core.BlockIndex


    if (lastRemovedDate != world.getTotalWorldTime()) {
      lastRemovedDate = world.getTotalWorldTime();
      pipeRemoved.clear();
    }

    pipeRemoved.put(new BlockIndex(x, y, z), pipe);
    world.removeTileEntity(x, y, z);

    updateNeighbourSignalState(pipe);

  }
View Full Code Here


    ArrayList<ItemStack> list = new ArrayList<ItemStack>();
    Pipe<?> pipe = getPipe(world, x, y, z);

    if (pipe == null) {
      pipe = pipeRemoved.get(new BlockIndex(x, y, z));
    }
   
    if (pipe != null) {
      if (pipe.item != null) {
        list.add(new ItemStack(pipe.item, 1, pipe.container.getItemMetadata()));
View Full Code Here

      return;
    }
    Pipe<?> pipe = getPipe(world, i, j, k);

    if (pipe == null) {
      pipe = pipeRemoved.get(new BlockIndex(i, j, k));
    }

    if (pipe != null) {
      Item k1 = pipe.item;
View Full Code Here

  public void iterate() {
    if (done) {
      return;
    } else if (currentSubReader == null && subIndex < architect.subBlueprints.size()) {
      BlockIndex subBlock = architect.subBlueprints.get(subIndex);

      TileEntity subTile = architect.getWorldObj().getTileEntity(subBlock.x, subBlock.y,
          subBlock.z);

      if (subTile instanceof TileArchitect) {
View Full Code Here

        list.add(StringUtils.localize("{" + x + ", " + y + ", " + z + "} + {" + xLength + " x " + yLength + " x " + zLength + "}"));
        break;
      }
      case 2: {
        NBTTagList pathNBT = cpt.getTagList("path", Constants.NBT.TAG_COMPOUND);
        BlockIndex first = new BlockIndex(pathNBT.getCompoundTagAt(0));

        int x = first.x;
        int y = first.y;
        int z = first.z;
View Full Code Here

    if (cpt.hasKey("kind") && cpt.getByte("kind") == 0) {
      int x = cpt.getInteger("x");
      int y = cpt.getInteger("y");
      int z = cpt.getInteger("z");

      return new BlockIndex(x, y, z);
    } else {
      return null;
    }
  }
View Full Code Here

    NBTTagList clearList = nbt.getTagList("clearList", Constants.NBT.TAG_COMPOUND);

    for (int i = 0; i < clearList.tagCount(); ++i) {
      NBTTagCompound cpt = clearList.getCompoundTagAt(i);

      clearedLocations.add (new BlockIndex(cpt));
    }

    NBTTagList builtList = nbt.getTagList("builtList", Constants.NBT.TAG_COMPOUND);

    for (int i = 0; i < builtList.tagCount(); ++i) {
      NBTTagCompound cpt = builtList.getCompoundTagAt(i);

      builtLocations.add (new BlockIndex(cpt));
    }

    NBTTagList buildingList = nbt
        .getTagList("buildersInAction",
            Constants.NBT.TAG_COMPOUND);
View Full Code Here

    List<BlockIndex> blocks = new ArrayList<BlockIndex>();

    for (float x = xMin; x <= xMax; x++) {
      for (float y = yMin; y <= yMax; y++) {
        for (float z = zMin; z <= zMax; z++) {
          blocks.add(new BlockIndex((int) x, (int) y, (int) z));
        }
      }
    }

    return blocks;
View Full Code Here

  public BlockIndex getRandomBlockIndex(Random rand) {
    int x = xMin + rand.nextInt(xMax - xMin);
    int y = yMin + rand.nextInt(yMax - yMin);
    int z = zMin + rand.nextInt(zMax - zMin);

    return new BlockIndex(x, y, z);

  }
View Full Code Here

            }

            SchematicBlockBase slot = blueprint.contents[i][j][k];

            if (slot == null
                && !clearedLocations.contains(new BlockIndex(
                    xCoord, yCoord, zCoord))) {
              BuildingSlotBlock b = new BuildingSlotBlock();

              b.schematic = null;
              b.x = xCoord;
              b.y = yCoord;
              b.z = zCoord;
              b.mode = Mode.ClearIfInvalid;
              b.buildStage = 0;

              buildList.add(b);
            }
          }
        }
      }
    }

    for (int j = 0; j < blueprint.sizeY; ++j) {
      for (int i = 0; i < blueprint.sizeX; ++i) {
        for (int k = 0; k < blueprint.sizeZ; ++k) {
          int xCoord = i + x - blueprint.anchorX;
          int yCoord = j + y - blueprint.anchorY;
          int zCoord = k + z - blueprint.anchorZ;

          if (yCoord < 0 || yCoord >= context.world.getHeight()) {
            continue;
          }

          SchematicBlockBase slot = blueprint.contents[i][j][k];

          if (slot != null && !builtLocations.contains(new BlockIndex(xCoord, yCoord, zCoord))) {
            BuildingSlotBlock b = new BuildingSlotBlock();

            b.schematic = slot;
            b.x = xCoord;
            b.y = yCoord;
View Full Code Here

TOP

Related Classes of buildcraft.api.core.BlockIndex

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.