Examples of IRoutedItem


Examples of logisticspipes.logisticspipes.IRoutedItem

    }
    return contentchanged;
  }

  public void sendStack(ItemRoutingInformation info, ForgeDirection dir) {
    IRoutedItem itemToSend = SimpleServiceLocator.routedItemHelper.createNewTravelItem(info);
    super.queueRoutedItem(itemToSend, dir);
    spawnParticle(Particles.OrangeParticle, 4);
  }
View Full Code Here

Examples of logisticspipes.logisticspipes.IRoutedItem

        continue;
      }

      FluidStack toSend = transport.sideTanks[dir.ordinal()].drain(result.getValue2(), true);
      ItemIdentifierStack liquidContainer = SimpleServiceLocator.logisticsFluidManager.getFluidContainer(toSend);
      IRoutedItem routed = SimpleServiceLocator.routedItemHelper.createNewTravelItem(liquidContainer);
      routed.setDestination(result.getValue1());
      routed.setTransportMode(TransportMode.Passive);
      this.queueRoutedItem(routed, dir);
      nextSendMax[dir.ordinal()] = 100;
      nextSendMin[dir.ordinal()] = 5;
    }
  }
View Full Code Here

Examples of logisticspipes.logisticspipes.IRoutedItem

    if(stack != null) {
      if(delay > 0) {
        delay--;
        return;
      }
      IRoutedItem itemToSend = SimpleServiceLocator.routedItemHelper.createNewTravelItem(stack);
      SimpleServiceLocator.logisticsManager.assignDestinationFor(itemToSend, this.getRouter().getSimpleID(), false);
      if(itemToSend.getDestinationUUID() != null) {
        ForgeDirection dir = this.getRouteLayer().getOrientationForItem(itemToSend, null);
        super.queueRoutedItem(itemToSend, dir.getOpposite());
        spawnParticle(Particles.OrangeParticle, 4);
        toSortInv.clearInventorySlotContents(0);
      } else {
View Full Code Here

Examples of logisticspipes.logisticspipes.IRoutedItem

          if(drained != null && order.getValue1().equals(FluidIdentifier.get(drained))) {
            drained = ((ISpecialTankAccessHandler)handler).drainFrom(pair.getValue1(), order.getValue1(), amountToSend, true);
            int amount = drained.amount;
            amountToSend -= amount;
            ItemIdentifierStack stack = SimpleServiceLocator.logisticsFluidManager.getFluidContainer(drained);
            IRoutedItem item = SimpleServiceLocator.routedItemHelper.createNewTravelItem(stack);
            item.setDestination(order.getValue3().getRouter().getSimpleID());
            item.setTransportMode(TransportMode.Active);
            this.queueRoutedItem(item, pair.getValue2());
            manager.sendAmount(amount);
            if(amountToSend <= 0) break;
          }
        }
      }
      if(fallback) {
        FluidTankInfo[] tanks = ((IFluidHandler)pair.getValue1()).getTankInfo(pair.getValue2().getOpposite());
        if(tanks != null) {
          for(FluidTankInfo tank:tanks) {
            if(tank == null) continue;
            FluidStack liquid;
            if((liquid = tank.fluid) != null && liquid.fluidID != 0) {
              if(order.getValue1().equals(FluidIdentifier.get(liquid))) {
                int amount = Math.min(liquid.amount, amountToSend);
                FluidStack drained = ((IFluidHandler)pair.getValue1()).drain(pair.getValue2().getOpposite(), amount, false);
                if(drained != null && order.getValue1().equals(FluidIdentifier.get(drained))) {
                  drained = ((IFluidHandler)pair.getValue1()).drain(pair.getValue2().getOpposite(), amount, true);
                  while(drained.amount < amountToSend) {
                    FluidStack addition = ((IFluidHandler)pair.getValue1()).drain(pair.getValue2().getOpposite(), amountToSend - drained.amount, false);
                    if(addition != null && order.getValue1().equals(FluidIdentifier.get(addition))) {
                      addition = ((IFluidHandler)pair.getValue1()).drain(pair.getValue2().getOpposite(), amountToSend - drained.amount, true);
                      drained.amount += addition.amount;
                    } else {
                      break;
                    }
                  }
                  amount = drained.amount;
                  amountToSend -= amount;
                  ItemIdentifierStack stack = SimpleServiceLocator.logisticsFluidManager.getFluidContainer(drained);
                  IRoutedItem item = SimpleServiceLocator.routedItemHelper.createNewTravelItem(stack);
                  item.setDestination(order.getValue3().getRouter().getSimpleID());
                  item.setTransportMode(TransportMode.Active);
                  this.queueRoutedItem(item, pair.getValue2());
                  manager.sendAmount(amount);
                  if(amountToSend <= 0) break;
                }
              }
View Full Code Here

Examples of logisticspipes.logisticspipes.IRoutedItem

      ItemStack removed = inv.getMultipleItems(item, wanted);
      if(removed == null || removed.stackSize == 0) continue;
      int sent = removed.stackSize;
      useEnergy(sent * neededEnergy());

      IRoutedItem routedItem = SimpleServiceLocator.routedItemHelper.createNewTravelItem(removed);
      routedItem.setDestination(destination);
      routedItem.setTransportMode(TransportMode.Active);
      routedItem.setAdditionalTargetInformation(info);
      super.queueRoutedItem(routedItem, tile.orientation);
     
      _orderManager.sendSuccessfull(sent, defersend, routedItem);
      return sent;
    }
View Full Code Here

Examples of logisticspipes.logisticspipes.IRoutedItem

      return 0;
    }
    int sent = removed.stackSize;
    _service.useEnergy(sent * neededEnergy());

    IRoutedItem sendedItem = _service.sendStack(removed, destination, itemSendMode(), info);
    _service.getOrderManager().sendSuccessfull(sent, defersend, sendedItem);
    return sent;
  }
View Full Code Here

Examples of logisticspipes.logisticspipes.IRoutedItem

      //TODO: FIX THIS
      if(this instanceof IRequireReliableFluidTransport) {
        ((IRequireReliableFluidTransport)this).liquidNotInserted(FluidIdentifier.get(liquid), liquid.amount);
      }
     
      IRoutedItem routedItem = SimpleServiceLocator.routedItemHelper.createNewTravelItem(SimpleServiceLocator.logisticsFluidManager.getFluidContainer(liquid));
      Pair<Integer, Integer> replies = SimpleServiceLocator.logisticsFluidManager.getBestReply(liquid, this.getRouter(), routedItem.getJamList());
      int dest = replies.getValue1();
      routedItem.setDestination(dest);
      routedItem.setTransportMode(TransportMode.Passive);
      this.queueRoutedItem(routedItem, arrivingItem.output.getOpposite());
      return true;
    }
    return false;
  }
View Full Code Here

Examples of logisticspipes.logisticspipes.IRoutedItem

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

  @Override
  public IRoutedItem sendStack(ItemStack stack, Pair<Integer, SinkReply> reply, ItemSendMode mode) {
    IRoutedItem itemToSend = SimpleServiceLocator.routedItemHelper.createNewTravelItem(stack);
    itemToSend.setDestination(reply.getValue1());
    if (reply.getValue2().isPassive){
      if (reply.getValue2().isDefault){
        itemToSend.setTransportMode(TransportMode.Default);
      } else {
        itemToSend.setTransportMode(TransportMode.Passive);
      }
    }
    queueRoutedItem(itemToSend, getPointedOrientation(), mode);
    return itemToSend;
  }
View Full Code Here

Examples of logisticspipes.logisticspipes.IRoutedItem

    return itemToSend;
  }

  @Override
  public IRoutedItem sendStack(ItemStack stack, int destination, ItemSendMode mode, IAdditionalTargetInformation info) {
    IRoutedItem itemToSend = SimpleServiceLocator.routedItemHelper.createNewTravelItem(stack);
    itemToSend.setDestination(destination);
    itemToSend.setTransportMode(TransportMode.Active);
    itemToSend.setAdditionalTargetInformation(info);
    queueRoutedItem(itemToSend, getPointedOrientation(), mode);
    return itemToSend;
  }
View Full Code Here

Examples of logisticspipes.logisticspipes.IRoutedItem

          SinkReply reply = LogisticsManager.canSink(nextOrder.getDestination().getRouter(), null, true, ItemIdentifier.get(stackToSend), null, true, false);
          boolean defersend = false;
          if(reply == null || reply.bufferMode != BufferMode.NONE || reply.maxNumberOfItems < 1) {
            defersend = true;
          }
          IRoutedItem item = SimpleServiceLocator.routedItemHelper.createNewTravelItem(stackToSend);
          item.setDestination(nextOrder.getDestination().getRouter().getSimpleID());
          item.setTransportMode(TransportMode.Active);
          item.setAdditionalTargetInformation(nextOrder.getInformation());
          _service.queueRoutedItem(item, tile.orientation);
          _service.getOrderManager().sendSuccessfull(stackToSend.stackSize, defersend, item);
          if(_service.getOrderManager().hasOrders(RequestType.CRAFTING)){
            nextOrder = _service.getOrderManager().peekAtTopRequest(RequestType.CRAFTING); // fetch but not remove.
          } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.