Package buildcraft.api.core

Examples of buildcraft.api.core.BlockIndex


    if (tick % 16 != 0) {
      return;
    }

    BlockIndex index = getNextIndexToPump(false);

    FluidStack fluidToPump = index != null ? BlockUtil.drainBlock(worldObj, index.x, index.y, index.z, false) : null;
    if (fluidToPump != null) {
      if (isFluidAllowed(fluidToPump.getFluid()) && tank.fill(fluidToPump, false) == fluidToPump.amount) {
        if (getBattery().useEnergy(100, 100, false) > 0) {
View Full Code Here


      if (topLayer.isEmpty()) {
        pumpLayerQueues.pollLastEntry();
      }

      if (remove) {
        BlockIndex index = topLayer.pollLast();
        return index;
      } else {
        return topLayer.peekLast();
      }
    } else {
View Full Code Here

      }
    }
  }

  public void queueForPumping(int x, int y, int z, Set<BlockIndex> visitedBlocks, Deque<BlockIndex> fluidsFound, Fluid pumpingFluid) {
    BlockIndex index = new BlockIndex(x, y, z);
    if (visitedBlocks.add(index)) {
      if ((x - xCoord) * (x - xCoord) + (z - zCoord) * (z - zCoord) > 64 * 64) {
        return;
      }

View Full Code Here

    }
  }

  @Override
  public boolean hasWork() {
    BlockIndex next = getNextIndexToPump(false);

    if (next != null) {
      return isPumpableFluid(next.x, next.y, next.z);
    } else {
      return false;
View Full Code Here

        float dx = xCoord - receiver.xCoord;
        float dy = yCoord - receiver.yCoord;
        float dz = zCoord - receiver.zCoord;

        if (dx * dx + dy * dy + dz * dz < 100 * 100) {
          BlockIndex index = new BlockIndex(receiver.xCoord, receiver.yCoord, receiver.zCoord);

          if (!targets.containsKey(index)) {
            addLaser(receiver.xCoord, receiver.yCoord,
                receiver.zCoord);

View Full Code Here

    this.getBattery().setEnergy(val);
  }

  @RPC (RPCSide.CLIENT)
  public void addLaser (int x, int y, int z) {
    BlockIndex index = new BlockIndex(x, y, z);

    if (!targets.containsKey(index)) {
      Target t = new Target();

      t.data.head.x = xCoord + 0.5F;
View Full Code Here

    }
  }

  @RPC (RPCSide.CLIENT)
  public void enableLaser (int x, int y, int z) {
    BlockIndex index = new BlockIndex(x, y, z);

    if (targets.containsKey(index)) {
      targets.get(index).data.isVisible = true;
    }
  }
View Full Code Here

    }
  }

  @RPC (RPCSide.CLIENT)
  public void disableLaser (int x, int y, int z) {
    BlockIndex index = new BlockIndex(x, y, z);

    if (targets.containsKey(index)) {
      targets.get(index).data.isVisible = false;
    }
  }
View Full Code Here

      initialized = true;

      if (firstEntity == null) {
        firstEntity = this;
      } else {
        PathFinding p = new PathFinding(worldObj, new BlockIndex(xCoord, yCoord, zCoord), new BlockIndex(
            firstEntity.xCoord, firstEntity.yCoord, firstEntity.zCoord));

        p.iterate(10000);

        LinkedList<BlockIndex> r = p.getResult();
View Full Code Here

      if (!ai.success()) {
        crafted = false;
        terminate();
      } else {
        stationFound = ((AIRobotSearchStation) ai).targetStation;
        furnace = getUsableFurnace(new BlockIndex(stationFound.x(), stationFound.y(), stationFound.z()));

        if (furnace == null) {
          terminate();
          return;
        }

        BlockIndex index = new BlockIndex(furnace);

        if (!robot.getRegistry().take(new ResourceIdBlock(index), robot)) {
          terminate();
        }
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.