Package logisticspipes.network.abstractpackets

Examples of logisticspipes.network.abstractpackets.ModernPacket


    } else {
      if(integer2 == 0) this.fuzzyFlags[integer].use_od = !this.fuzzyFlags[integer].use_od;
      if(integer2 == 1) this.fuzzyFlags[integer].ignore_dmg = !this.fuzzyFlags[integer].ignore_dmg;
      if(integer2 == 2) this.fuzzyFlags[integer].ignore_nbt = !this.fuzzyFlags[integer].ignore_nbt;
      if(integer2 == 3) this.fuzzyFlags[integer].use_category = !this.fuzzyFlags[integer].use_category;
      ModernPacket pak = PacketHandler.getPacket(CraftingTableFuzzyFlagsModifyPacket.class)
          .setInteger2((fuzzyFlags[integer].use_od ? 1 : 0)
              | (fuzzyFlags[integer].ignore_dmg ? 2 : 0)
              | (fuzzyFlags[integer].ignore_nbt ? 4 : 0)
              | (fuzzyFlags[integer].use_category ? 8 : 0))
          .setInteger(integer)
View Full Code Here


  protected void actionPerformed(GuiButton guibutton) {
   
    if (guibutton.id >= 0 && guibutton.id <= 7){
      LogisticsModule module = _chassiPipe.getLogisticsModule().getSubModule(guibutton.id);
      if (module != null){
        final ModernPacket packet = PacketHandler
            .getPacket(ChassisGUI.class).setButtonID(guibutton.id)
            .setPosX(_chassiPipe.getX())
            .setPosY(_chassiPipe.getY())
            .setPosZ(_chassiPipe.getZ());
        MainProxy.sendPacketToServer(packet);
View Full Code Here

    int currentid = 0;

    for (ClassInfo c : classes) {
      final Class<?> cls = c.load();
      final ModernPacket instance = (ModernPacket) cls.getConstructor(int.class).newInstance(currentid);
      packetlist.add(instance);
      packetmap.put((Class<? extends ModernPacket>) cls, instance);
      currentid++;
    }
  }
View Full Code Here

  @Override
  protected final void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List<Object> out) throws Exception
  {
    ByteBuf payload = msg.payload();
    int packetID = payload.readShort();
    final ModernPacket packet = PacketHandler.packetlist.get(packetID).template();
    packet.setDebugId(payload.readInt());
    ctx.attr(INBOUNDPACKETTRACKER).get().set(msg);
    packet.readData(new LPDataInputStream(payload.slice()));
    out.add(new InboundModernPacketWrapper(packet, MainProxy.proxy.getEntityPlayerFromNetHandler(msg.handler())));
  }
View Full Code Here

  //hacky callback to process packets coming from by the packetbufferhandler decompressors
  //TODO replace with proper netty implementation
  public static void onPacketData(final LPDataInputStream data, final EntityPlayer player) throws IOException {
    if(player == null) return;
    final int packetID = data.readShort();
    final ModernPacket packet = PacketHandler.packetlist.get(packetID).template();
    packet.setDebugId(data.readInt());
    packet.readData(data);
    onPacketData(packet, player);
  }
View Full Code Here

 
  @Override
  public void playerStartWatching(EntityPlayer player, int mode) {
    if(mode == 1) {
      localModeWatchers.add(player);
      final ModernPacket packet = PacketHandler.getPacket(SatPipeSetID.class).setSatID((this).satelliteId).setPosX(getX()).setPosY(getY()).setPosZ(getZ());
      MainProxy.sendPacketToPlayer(packet, player);
      updateInv(true);
    } else {
      super.playerStartWatching(player, mode);
    }
View Full Code Here

  public void setNextId(EntityPlayer player) {
    satelliteId = findId(1);
    ensureAllSatelliteStatus();
    if (MainProxy.isClient(player.worldObj)) {
      final ModernPacket packet = PacketHandler.getPacket(SatPipeNext.class).setPosX(getX()).setPosY(getY()).setPosZ(getZ());
      MainProxy.sendPacketToServer(packet);
    } else {
      final ModernPacket packet = PacketHandler.getPacket(SatPipeSetID.class).setSatID(satelliteId).setPosX(getX()).setPosY(getY()).setPosZ(getZ());
      MainProxy.sendPacketToPlayer(packet, player);
    }
    updateWatchers();
  }
View Full Code Here

  public void setPrevId(EntityPlayer player) {
    satelliteId = findId(-1);
    ensureAllSatelliteStatus();
    if (MainProxy.isClient(player.worldObj)) {
      final ModernPacket packet = PacketHandler.getPacket(SatPipePrev.class).setPosX(getX()).setPosY(getY()).setPosZ(getZ());
      MainProxy.sendPacketToServer(packet);
    } else {
      final ModernPacket packet = PacketHandler.getPacket(SatPipeSetID.class).setSatID(satelliteId).setPosX(getX()).setPosY(getY()).setPosZ(getZ());
      MainProxy.sendPacketToPlayer(packet, player);
    }
    updateWatchers();
  }
View Full Code Here

            break;
          }
        }
      }
    }
    ModernPacket packet = PacketHandler.getPacket(PipeSignTypes.class).setTypes(types).setTilePos(container);
    MainProxy.sendPacketToAllWatchingChunk(getX(), getZ(), MainProxy.getDimensionForWorld(getWorld()), packet);
    MainProxy.sendPacketToPlayer(packet, player);
    for(int i=0;i<6;i++) {
      if(signItem[i] != null) {
        packet = signItem[i].getPacket();
View Full Code Here

  }

  @Override
  public void onWrenchClicked(EntityPlayer entityplayer) {
    // Send the satellite id when opening gui
    final ModernPacket packet = PacketHandler.getPacket(SatPipeSetID.class).setSatID(satelliteId).setPosX(getX()).setPosY(getY()).setPosZ(getZ());
    MainProxy.sendPacketToPlayer(packet, entityplayer);
    entityplayer.openGui(LogisticsPipes.instance, GuiIDs.GUI_SatelitePipe_ID, getWorld(), getX(), getY(), getZ());
  }
View Full Code Here

TOP

Related Classes of logisticspipes.network.abstractpackets.ModernPacket

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.