Examples of CoreRoutedPipe


Examples of logisticspipes.pipes.basic.CoreRoutedPipe

  private void refreshList(double x,double y,double z) {
    ArrayList<Pair<Double,IHeadUpDisplayRendererProvider>> newList = new ArrayList<Pair<Double,IHeadUpDisplayRendererProvider>>();
    for(IRouter router:SimpleServiceLocator.routerManager.getRouters()) {
      if(router == null)
        continue;
      CoreRoutedPipe pipe = router.getPipe();
      if(!(pipe instanceof IHeadUpDisplayRendererProvider)) continue;
      if(MainProxy.getDimensionForWorld(pipe.getWorld()) == MainProxy.getDimensionForWorld(FMLClientHandler.instance().getClient().theWorld)) {
        double dis = Math.hypot(pipe.getX() - x + 0.5,Math.hypot(pipe.getY() - y + 0.5, pipe.getZ() - z + 0.5));
        if(dis < Configs.LOGISTICS_HUD_RENDER_DISTANCE && dis > 0.75) {
          newList.add(new Pair<Double,IHeadUpDisplayRendererProvider>(dis,(IHeadUpDisplayRendererProvider)pipe));
          if(!list.contains(pipe)) {
            ((IHeadUpDisplayRendererProvider)pipe).startWatching();
          }
View Full Code Here

Examples of logisticspipes.pipes.basic.CoreRoutedPipe

    if(!init) {
      if(hasConnectionUUID()) {
        if(!SimpleServiceLocator.connectionManager.addDirectConnection(getConnectionUUID(), getRouter())) {
          dropFreqCard();
        }
        CoreRoutedPipe CRP = SimpleServiceLocator.connectionManager.getConnectedPipe(getRouter());
        if(CRP != null) {
          CRP.refreshRender(true);
        }
        getRouter().update(true, this);
        this.refreshRender(true);
        init = true;
        idbuffer = getConnectionUUID();
      }
    }
    if(init && !hasConnectionUUID()) {
      init = false;
      CoreRoutedPipe CRP = SimpleServiceLocator.connectionManager.getConnectedPipe(getRouter());
      SimpleServiceLocator.connectionManager.removeDirectConnection(getRouter());
      if(CRP != null) {
        CRP.refreshRender(true);
      }
    }
    if(init && idbuffer != null && !idbuffer.equals(getConnectionUUID())) {
      init = false;
      CoreRoutedPipe CRP = SimpleServiceLocator.connectionManager.getConnectedPipe(getRouter());
      SimpleServiceLocator.connectionManager.removeDirectConnection(getRouter());
      if(CRP != null) {
        CRP.refreshRender(true);
      }
    }
    if(itemsOnRoute.size() > 0) {
      checkConnectedInvs();
    }
View Full Code Here

Examples of logisticspipes.pipes.basic.CoreRoutedPipe

  }

  @Override
  public void onAllowedRemoval() {
    if(!stillNeedReplace) {
      CoreRoutedPipe CRP = SimpleServiceLocator.connectionManager.getConnectedPipe(getRouter());
      SimpleServiceLocator.connectionManager.removeDirectConnection(getRouter());
      if(CRP != null) {
        CRP.refreshRender(true);
      }
    }
    dropFreqCard();
  }
View Full Code Here

Examples of logisticspipes.pipes.basic.CoreRoutedPipe

 

  @Override
  public void invalidate() {
    if(!stillNeedReplace) {
      CoreRoutedPipe CRP = SimpleServiceLocator.connectionManager.getConnectedPipe(getRouter());
      SimpleServiceLocator.connectionManager.removeDirectConnection(getRouter());
      if(CRP != null) {
        CRP.refreshRender(true);
      }
    }
    init = false;
    super.invalidate();
  }
View Full Code Here

Examples of logisticspipes.pipes.basic.CoreRoutedPipe

 
 
  @Override
  public void onChunkUnload() {
    if(!stillNeedReplace) {
      CoreRoutedPipe CRP = SimpleServiceLocator.connectionManager.getConnectedPipe(getRouter());
      SimpleServiceLocator.connectionManager.removeDirectConnection(getRouter());
      if(CRP != null) {
        CRP.refreshRender(true);
      }
    }
    init = false;
    super.onChunkUnload();
  }
View Full Code Here

Examples of logisticspipes.pipes.basic.CoreRoutedPipe

  public void handleItemEnterInv(ItemRoutingInformation info, TileEntity tile) {
    if(info.getItem().getStackSize()==0)
      return; // system.throw("why you try to insert empty stack?");
    if(isConnectedInv(tile)) {
      if(hasRemoteConnection()) {
        CoreRoutedPipe CRP = SimpleServiceLocator.connectionManager.getConnectedPipe(getRouter());
        if(CRP instanceof IDirectRoutingConnection) {
          IDirectRoutingConnection pipe = (IDirectRoutingConnection) CRP;
          pipe.addItem(info);
          spawnParticle(Particles.OrangeParticle, 4);
        }
View Full Code Here

Examples of logisticspipes.pipes.basic.CoreRoutedPipe

    SimpleServiceLocator.serverBufferHandler.setPause(true);
    while(firstRouter != -1 && slotSentCount < inventorySlotsToUpdatePerTick){
      routersNeedingUpdate.clear(firstRouter);
      IRouter currentRouter = rm.getRouterUnsafe(firstRouter, false);
      if(currentRouter != null) {
        CoreRoutedPipe pipe = currentRouter.getCachedPipe();
        if(pipe!=null)
          slotSentCount += pipe.sendQueueChanged(true);
      }
      firstRouter = routersNeedingUpdate.nextSetBit(firstRouter);
    }
    //and let it compress and send
    SimpleServiceLocator.serverBufferHandler.setPause(false);
View Full Code Here

Examples of logisticspipes.pipes.basic.CoreRoutedPipe

    int mode = itemStack.getTagCompound().getInteger("CreatorMode");
   
    ForgeDirection dir = ForgeDirection.getOrientation(sideinput);
    if(dir == ForgeDirection.UNKNOWN) return false;
   
    CoreRoutedPipe pipe = (CoreRoutedPipe) ((LogisticsTileGenericPipe)tile).pipe;
    if(pipe == null) { return false; }
    if(!player.isSneaking()) {
      if(pipe.hasPipeSign(dir)) {
        pipe.activatePipeSign(dir, player);
        return true;
      } else if(mode >= 0 && mode < signTypes.size()) {
        Class<? extends IPipeSign> signClass = signTypes.get(mode);
        try {
          IPipeSign sign = signClass.newInstance();
          if(sign.isAllowedFor(pipe)) {
            itemStack.damageItem(1, player);
            sign.addSignTo(pipe, dir, player);
            return true;
          } else {
            return false;
          }
        } catch(InstantiationException e) {
          throw new RuntimeException(e);
        } catch(IllegalAccessException e) {
          throw new RuntimeException(e);
        }
      } else {
        return false;
      }
    } else {
      if(pipe.hasPipeSign(dir)) {
        pipe.removePipeSign(dir, player);
        itemStack.damageItem(-1, player);
      }
      return true;
    }
  }
View Full Code Here

Examples of logisticspipes.pipes.basic.CoreRoutedPipe

      if(r.getPipe() instanceof IFluidProvider){
        List<ExitRoute> e = target.getRouter().getDistanceTo(r);
        if (e!=null) {
          for(ExitRoute route: e) {
            if(!route.filters.isEmpty()) continue;
            CoreRoutedPipe pipe = route.destination.getPipe();
            if (pipe instanceof IFluidProvider){
              providers.add((IFluidProvider)pipe);
            }
          }
        }
View Full Code Here

Examples of logisticspipes.pipes.basic.CoreRoutedPipe

                      if(exit.containsFlag(PipeRoutingConnectionType.canPowerSubSystemFrom)) {
                        for(IFilter filter:exit.filters) {
                          if(filter.blockPower()) continue outerRouters;
                        }
                        //MainProxy.sendPacketToAllWatchingChunk(xCoord, zCoord, sourceRouter.getDimension(), PacketHandler.getPacket(PowerPacketLaser.class).setColor(this.getLaserColor()).setPos(sourceRouter.getLPPosition()).setDir(adjacent.orientation.getOpposite()).setReverse(true).setLength(1));
                        CoreRoutedPipe pipe = sourceRouter.getPipe();
                        if(pipe != null && pipe.container instanceof LogisticsTileGenericPipe) {
                          ((LogisticsTileGenericPipe)pipe.container).addLaser(adjacent.orientation.getOpposite(), 1, this.getLaserColor(), true, true);
                        }
                        try {
                          currentlyUsedPos.add(sourceRouter.getLPPosition());
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.