Package forestry.core.network

Examples of forestry.core.network.PacketUpdate


  @Override
  public void onPacketData(int packetID, DataInputStream data, EntityPlayer player) {

    try {
      PacketUpdate packetU;
      switch (packetID) {
      // CLIENT
      case PacketIds.PROP_SEND_FILTER_SET:
        PacketNBT packetN = new PacketNBT();
        packetN.readData(data);
        onFilterSet(packetN);
        break;

      // SERVER
      case PacketIds.PROP_REQUEST_FILTER_SET:
        PacketCoordinates packetC = new PacketCoordinates();
        packetC.readData(data);
        onRequestFilterSet(player, packetC);
        break;
      case PacketIds.PROP_SEND_FILTER_CHANGE_TYPE:
        packetU = new PacketUpdate();
        packetU.readData(data);
        onTypeFilterChange(player, packetU);
        break;
      case PacketIds.PROP_SEND_FILTER_CHANGE_GENOME:
        packetU = new PacketUpdate();
        packetU.readData(data);
        onGenomeFilterChange(player, packetU);
        break;

      }
    } catch (Exception ex) {
View Full Code Here


  public void sendTypeFilterChange(ForgeDirection orientation, EnumFilterType filter) {
    PacketPayload payload = new PacketPayload(2, 0, 0);
    payload.intPayload[0] = orientation.ordinal();
    payload.intPayload[1] = filter.ordinal();
    Proxies.net.sendToServer(new PacketUpdate(PacketIds.PROP_SEND_FILTER_CHANGE_TYPE, pipe.container.xCoord, pipe.container.yCoord, pipe.container.zCoord, payload));
  }
View Full Code Here

    if (species != null)
      payload.stringPayload[0] = species.getUID();
    else
      payload.stringPayload[0] = "NULL";

    Proxies.net.sendToServer(new PacketUpdate(PacketIds.PROP_SEND_FILTER_CHANGE_GENOME, pipe.container.xCoord, pipe.container.yCoord, pipe.container.zCoord, payload));
  }
View Full Code Here

  public void sendNetworkUpdate() {
    Proxies.net.sendNetworkPacket(toPacket(), xCoord, yCoord, zCoord);
  }

  private void sendNetworkUpdateRipening() {
    Proxies.net.sendNetworkPacket(new PacketUpdate(PacketIds.TILE_UPDATE, xCoord, yCoord, zCoord, maturity), xCoord, yCoord, zCoord);
  }
View Full Code Here

    PacketPayload payload = new PacketPayload(indices.length, 1);
    payload.shortPayload[0] = maturity;
    payload.intPayload = indices;

    return new PacketUpdate(PacketIds.TILE_UPDATE, xCoord, yCoord, zCoord, payload);
  }
View Full Code Here

    return new PacketUpdate(PacketIds.TILE_UPDATE, xCoord, yCoord, zCoord, payload);
  }

  @Override
  public void fromPacket(ForestryPacket packetRaw) {
    PacketUpdate packet = (PacketUpdate) packetRaw;
    maturity = packet.payload.shortPayload[0];

    if (packet.payload.intPayload != null && packet.payload.intPayload.length > 0) {
      indices = packet.payload.intPayload;
    }
View Full Code Here

  }

  private void flipPage(int page) {
    PacketPayload payload = new PacketPayload(1, 0, 0);
    payload.intPayload[0] = page;
    PacketUpdate packet = new PacketUpdate(PacketIds.GUI_SELECTION_CHANGE, payload);
    Proxies.net.sendToServer(packet);
  }
View Full Code Here

  public void handleChipsetClick(int slot, EntityPlayer player, ItemStack itemstack) {
    if (!Proxies.common.isSimulating(player.worldObj)) {
      PacketPayload payload = new PacketPayload(1, 0, 0);
      payload.intPayload[0] = slot;
      Proxies.net.sendToServer(new PacketUpdate(PacketIds.CHIPSET_CLICK, payload));
      player.inventory.setItemStack(null);
      return;
    }

    ItemStack toSocket = itemstack.copy();
View Full Code Here

  public void handleSolderingIronClick(int slot, EntityPlayer player, ItemStack itemstack) {
    if (!Proxies.common.isSimulating(player.worldObj)) {
      PacketPayload payload = new PacketPayload(1, 0, 0);
      payload.intPayload[0] = slot;
      Proxies.net.sendToServer(new PacketUpdate(PacketIds.SOLDERING_IRON_CLICK, payload));
      return;
    }

    ItemStack socket = tile.getSocket(slot);
    if (socket == null)
View Full Code Here

      return;

    if (!Proxies.common.isSimulating(player.worldObj)) {
      PacketPayload payload = new PacketPayload(1, 0, 0);
      payload.intPayload[0] = slot;
      Proxies.net.sendToServer(new PacketUpdate(PacketIds.PIPETTE_CLICK, payload));
      return;
    }

    IToolPipette pipette = (IToolPipette) held;
    StandardTank tank = tile.getTankManager().get(slot);
View Full Code Here

TOP

Related Classes of forestry.core.network.PacketUpdate

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.