Package logisticspipes.utils.tuples

Examples of logisticspipes.utils.tuples.LPPosition


  }

  private boolean isValidOrientation(ForgeDirection connection){
    if (connection == ForgeDirection.UNKNOWN) return false;
    if (getRouter().isRoutedExit(connection)) return false;
    LPPosition pos = new LPPosition(getX(), getY(), getZ());
    pos.moveForward(connection);
    TileEntity tile = pos.getTileEntity(getWorld());

    if (tile == null) return false;
    if (SimpleServiceLocator.pipeInformaitonManager.isPipe(tile)) return false;
    return MainProxy.checkPipesConnections(this.container, tile, connection);
  }
View Full Code Here


    return hasConnectionUUID() && this.getWorld() != null && SimpleServiceLocator.connectionManager.hasDirectConnection(getRouter());
  }
 
  private boolean inventoryConnected() {
    for (int i = 0; i < 6; i++)  {
      LPPosition p = new LPPosition(getX(), getY(), getZ());
      p.moveForward(ForgeDirection.values()[i]);
      TileEntity tile = p.getTileEntity(getWorld());
      if(tile instanceof IInventory) {
        return true;
      }
    }
    return false;
View Full Code Here

    }
  }
 
  public boolean isConnectedInv(TileEntity tile) {
    for (int i = 0; i < 6; i++)  {
      LPPosition p = new LPPosition(getX(), getY(), getZ());
      p.moveForward(ForgeDirection.values()[i]);
      TileEntity lTile = p.getTileEntity(getWorld());
      if(lTile instanceof IInventory) {
        if(lTile == tile) {
          return true;
        }
        return false;
View Full Code Here

    }
    return foundTiles;
  }
 
  public TileEntity getAdjacentTileEntitie(ForgeDirection direction) {
    LPPosition p = new LPPosition(_x, _y, _z);
    p.moveForward(direction);
    return p.getTileEntity(_worldObj);
  }
View Full Code Here

    int count = quantityDropped(metadata, fortune, world.rand);
    for (int i = 0; i < count; i++) {
      CoreUnroutedPipe pipe = getPipe(world, x, y, z);

      if (pipe == null) {
        pipe = pipeRemoved.get(new LPPosition(x, y, z));
      }

      if (pipe != null) {
        if (pipe.item != null && (pipe.canBeDestroyed() || pipe.destroyByPlayer())) {
          list.addAll(pipe.dropContents());
View Full Code Here

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

    pipeRemoved.put(new LPPosition(x, y, z), pipe);
    world.removeTileEntity(x, y, z);
    updateNeighbourSignalState(pipe);
  }
View Full Code Here

      }

      CoreUnroutedPipe pipe = getPipe(world, i, j, k);

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

      if (pipe.item != null && (pipe.canBeDestroyed() || pipe.destroyByPlayer())) {
        for(ItemStack stack:pipe.dropContents()) {
          dropBlockAsItem(world, i, j, k, stack);
View Full Code Here

    }
    hasWork = hasWork();
    if(hasWork && heat < 100) {
      boolean usedEnergy = false;
      for(ForgeDirection dir:ForgeDirection.VALID_DIRECTIONS) {
        LPPosition pos = new LPPosition(this);
        pos.moveForward(dir);
        TileEntity tile = pos.getTileEntity(getWorldObj());
        if(!(tile instanceof LogisticsTileGenericPipe)) continue;
        LogisticsTileGenericPipe tPipe = (LogisticsTileGenericPipe) tile;
        if(!(tPipe.pipe instanceof CoreRoutedPipe)) continue;
        CoreRoutedPipe pipe = (CoreRoutedPipe) tPipe.pipe;
        if(pipe.useEnergy(50)) {
          heat += 5;
          if(heat > 100) {
            heat = 100;
          }
          updateHeat();
          usedEnergy = true;
          break;
        }
      }
      if(!usedEnergy && getWorldObj().getTotalWorldTime() % 5 == 0) {
        heat--;
        if(heat < 0) {
          heat = 0;
        }
        updateHeat();
      }
    } else if(!hasWork && heat > 0) {
      heat--;
      updateHeat();
    }
    if(hasWork && heat >= 100) {
      for(ForgeDirection dir:ForgeDirection.VALID_DIRECTIONS) {
        LPPosition pos = new LPPosition(this);
        pos.moveForward(dir);
        TileEntity tile = pos.getTileEntity(getWorldObj());
        if(!(tile instanceof LogisticsTileGenericPipe)) continue;
        LogisticsTileGenericPipe tPipe = (LogisticsTileGenericPipe) tile;
        if(!(tPipe.pipe instanceof CoreRoutedPipe)) continue;
        CoreRoutedPipe pipe = (CoreRoutedPipe) tPipe.pipe;
        if(pipe.useEnergy(30)) {
View Full Code Here

    return _dimension == dimension && _xCoord == xCoord && _yCoord == yCoord && _zCoord == zCoord;
  }
 
  @Override
  public LPPosition getLPPosition() {
    return new LPPosition(_xCoord, _yCoord, _zCoord);
  }
View Full Code Here

    return SimpleServiceLocator.logisticsManager.hasDestination(stack, allowDefault, getRouter().getSimpleID(), routerIDsToExclude);
  }

  public ForgeDirection getPointedOrientation() {
    for(ForgeDirection ori:ForgeDirection.values()) {
      LPPosition pos = new LPPosition((TileEntity) this.container);
      pos.moveForward(ori);
      TileEntity tile = pos.getTileEntity(this.getWorld());
      if(tile != null) {
        if(SimpleServiceLocator.forestryProxy.isTileAnalyser(tile)) {
          return ori;
        }
      }
View Full Code Here

TOP

Related Classes of logisticspipes.utils.tuples.LPPosition

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.