Examples of LPTravelingItemClient


Examples of logisticspipes.transport.LPTravelingItem.LPTravelingItemClient

    MainProxy.sendPacketToAllWatchingChunk(this.container.xCoord, this.container.zCoord, MainProxy.getDimensionForWorld(this.getWorld()), (PacketHandler.getPacket(PipePositionPacket.class).setSpeed(item.getSpeed()).setPosition(item.getPosition()).setInput(item.input).setOutput(item.output).setTravelId(item.getId()).setTilePos(container)));
  }
 
  public void handleItemPositionPacket(int travelId, ForgeDirection input, ForgeDirection output, float speed, float position) {
    WeakReference<LPTravelingItemClient> ref = LPTravelingItem.clientList.get(travelId);
    LPTravelingItemClient item = null;
    if(ref != null) item = ref.get();
    if(item == null) {
      sendItemContentRequest(travelId);
      item = new LPTravelingItemClient(travelId, position, input, output);
      item.setSpeed(speed);
      LPTravelingItem.clientList.put(travelId, new WeakReference<LPTravelingItemClient>(item));
    } else {
      if(item.getContainer() instanceof LogisticsTileGenericPipe) {
        ((PipeTransportLogistics)((LogisticsTileGenericPipe)item.getContainer()).pipe.transport).items.scheduleRemoval(item);
        ((PipeTransportLogistics)((LogisticsTileGenericPipe)item.getContainer()).pipe.transport).items.removeScheduledItems();
      }
      item.updateInformation(input, output, speed, position);
    }
    //update lastTicked so we don't double-move items
    item.lastTicked = MainProxy.getGlobalTick();
    if(items.get(travelId) == null) {
      items.add(item);
View Full Code Here

Examples of logisticspipes.transport.LPTravelingItem.LPTravelingItemClient

  }
 
  @Override
  public void processPacket(EntityPlayer player) {
    WeakReference<LPTravelingItemClient> ref = LPTravelingItem.clientList.get(travelId);
    LPTravelingItemClient content = null;
    if(ref != null) content = ref.get();
    if(content == null) {
      content = new LPTravelingItemClient(travelId, item);
      LPTravelingItem.clientList.put(travelId, new WeakReference<LPTravelingItemClient>(content));
      synchronized(LPTravelingItem.forceKeep) {
        LPTravelingItem.forceKeep.add(new Pair<Integer, Object>(10, content)); //Keep in memory for min 10 ticks
      }
    } else {
      content.setItem(item);
    }
  }
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.