Package logisticspipes.utils

Examples of logisticspipes.utils.WorldUtil


      if(amount > 0) {
        _service.spawnParticle(Particles.VioletParticle, 2);
      }
    }

    WorldUtil worldUtil = new WorldUtil(_world.getWorld(), getX(), getY(), getZ());
    for (AdjacentTile tile :  worldUtil.getAdjacentTileEntities(true)){
      if (!(tile.tile instanceof IInventory)) continue;
     
      IInventory inv = (IInventory) tile.tile;
      if (inv.getSizeInventory() < 1) continue;
      IInventoryUtil invUtil = SimpleServiceLocator.inventoryUtilFactory.getInventoryUtil(inv);
View Full Code Here


  }

  private void checkConnectedInvs() {
    if(!itemsOnRoute.isEmpty()) { // don't check the inventory if you don't want anything
 
      WorldUtil wUtil = new WorldUtil(getWorld(), getX(), getY(), getZ());
      for (AdjacentTile tile : wUtil.getAdjacentTileEntities(true)){
        if(tile.tile instanceof IInventory) {
          IInventory inv = InventoryHelper.getInventory((IInventory) tile.tile);
          if(inv instanceof net.minecraft.inventory.ISidedInventory) {
            inv = new SidedInventoryMinecraftAdapter((net.minecraft.inventory.ISidedInventory)inv, tile.orientation.getOpposite(),false);
          }
View Full Code Here

      }
      if(event.action == Action.RIGHT_CLICK_BLOCK) {
        final TileEntity tile = event.entityPlayer.worldObj.getTileEntity(event.x, event.y, event.z);
        if(tile instanceof TileEntityChest || SimpleServiceLocator.ironChestProxy.isIronChest(tile)) {
          List<WeakReference<ModuleQuickSort>> list = new ArrayList<WeakReference<ModuleQuickSort>>();
          for(AdjacentTile adj:new WorldUtil(tile).getAdjacentTileEntities()) {
            if(adj.tile instanceof LogisticsTileGenericPipe) {
              if(((LogisticsTileGenericPipe)adj.tile).pipe instanceof PipeLogisticsChassi) {
                if(((PipeLogisticsChassi)((LogisticsTileGenericPipe)adj.tile).pipe).getPointedOrientation() == adj.orientation.getOpposite()) {
                  PipeLogisticsChassi chassi = (PipeLogisticsChassi)((LogisticsTileGenericPipe)adj.tile).pipe;
                  for(int i=0;i<chassi.getChassiSize();i++) {
View Full Code Here

        && ((isExcludeFilter() && itemIsFiltered(item))
            || (!isExcludeFilter() && !itemIsFiltered(item)))) return 0;
   
   
    int count = 0;
    WorldUtil wUtil = new WorldUtil(getWorld(), getX(), getY(), getZ());
    for (AdjacentTile tile : wUtil.getAdjacentTileEntities(true)){
      if (!(tile.tile instanceof IInventory)) continue;
      if (SimpleServiceLocator.pipeInformaitonManager.isPipe(tile.tile)) continue;
      IInventoryUtil inv = this.getAdaptedInventoryUtil(tile);
      count += inv.itemCount(item);
    }
View Full Code Here

  }
 
  private int sendStack(ItemIdentifierStack stack, int maxCount, int destination, IAdditionalTargetInformation info) {
    ItemIdentifier item = stack.getItem();
   
    WorldUtil wUtil = new WorldUtil(getWorld(), getX(), getY(), getZ());
    for (AdjacentTile tile : wUtil.getAdjacentTileEntities(true)){
      if (!(tile.tile instanceof IInventory)) continue;
      if (SimpleServiceLocator.pipeInformaitonManager.isPipe(tile.tile)) continue;
     
      IInventoryUtil inv = getAdaptedInventoryUtil(tile);
      int available = inv.itemCount(item);
View Full Code Here

    if (!isEnabled()){
      return;
    }
    HashMap<ItemIdentifier, Integer> addedItems = new HashMap<ItemIdentifier, Integer>();
   
    WorldUtil wUtil = new WorldUtil(getWorld(), getX(), getY(), getZ());
    for (AdjacentTile tile : wUtil.getAdjacentTileEntities(true)){
      if (!(tile.tile instanceof IInventory)) continue;
      if (SimpleServiceLocator.pipeInformaitonManager.isPipe(tile.tile)) continue;
      IInventoryUtil inv = this.getAdaptedInventoryUtil(tile);
     
      Map<ItemIdentifier, Integer> currentInv = inv.getItemsAndCount();
View Full Code Here

    itemListOrderer.addAll(list);
  }

  @Override //work in progress, currently not active code.
  public Set<ItemIdentifier> getSpecificInterests() {
    WorldUtil wUtil = new WorldUtil(getWorld(), getX(), getY(), getZ());
    Set<ItemIdentifier> l1 = null;
    for (AdjacentTile tile : wUtil.getAdjacentTileEntities(true)){
      if (!(tile.tile instanceof IInventory)) continue;
      if (SimpleServiceLocator.pipeInformaitonManager.isPipe(tile.tile)) continue;
     
      IInventoryUtil inv = getAdaptedInventoryUtil(tile);
      Set<ItemIdentifier> items = inv.getItems();
View Full Code Here

  /***
   * @param flag  Weather to list a Nearby Pipe or not
   */
 
  public final List<Pair<TileEntity,ForgeDirection>> getAdjacentTanks(boolean flag) {
    if(worldUtil == null) worldUtil = new WorldUtil(getWorld(), getX(), getY(), getZ());
    List<Pair<TileEntity,ForgeDirection>> tileList =  new ArrayList<Pair<TileEntity,ForgeDirection>>();
    for(ForgeDirection dir:ForgeDirection.VALID_DIRECTIONS) {
      TileEntity tile = worldUtil.getAdjacentTileEntitie(dir);
      if(!isConnectableTank(tile, dir, flag)) continue;
      tileList.add(new Pair<TileEntity,ForgeDirection>(tile, dir));
View Full Code Here

  }

  public void scheduleNeighborChange() {
    blockNeighborChange = true;
    boolean connected[] = new boolean[6];
    WorldUtil world = new WorldUtil(this.getWorld(), this.xCoord, this.yCoord, this.zCoord);
    LinkedList<AdjacentTile> adjacent = world.getAdjacentTileEntities(false);
    for(AdjacentTile aTile: adjacent) {
      if(SimpleServiceLocator.ccProxy.isTurtle(aTile.tile)) {
        connected[aTile.orientation.ordinal()] = true;
      }
    }
View Full Code Here

          if(toSend > internalStorage) {
            toSend = internalStorage;
          }
          IRouter destinationRouter = SimpleServiceLocator.routerManager.getRouter(order.getKey());
          if(destinationRouter != null && destinationRouter.getPipe() != null) {
            WorldUtil util = new WorldUtil(getWorldObj(), xCoord, yCoord, zCoord);
            outerTiles:
            for(AdjacentTile adjacent: util.getAdjacentTileEntities(false)) {
              if(adjacent.tile instanceof LogisticsTileGenericPipe) {
                if(((LogisticsTileGenericPipe)adjacent.tile).pipe instanceof CoreRoutedPipe) {
                  if(((CoreRoutedPipe)((LogisticsTileGenericPipe)adjacent.tile).pipe).stillNeedReplace()) continue;
                  IRouter sourceRouter = ((CoreRoutedPipe)((LogisticsTileGenericPipe)adjacent.tile).pipe).getRouter();
                  if(sourceRouter != null) {
View Full Code Here

TOP

Related Classes of logisticspipes.utils.WorldUtil

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.