Package forestry.core.network

Examples of forestry.core.network.PacketPayload


public abstract class Engine extends TileBase implements IEnergyHandler {

  @Override
  public PacketPayload getPacketPayload() {
    PacketPayload payload = new PacketPayload(3, 1, 0);

    if (this.isActive)
      payload.intPayload[0] = 1;
    else
      payload.intPayload[0] = 0;
View Full Code Here


    }
  }

  @Override
  public PacketPayload getPacketPayload() {
    PacketPayload payload = new PacketPayload(0, 1);
    payload.shortPayload[0] = (short) animationDelay;
    return payload;
  }
View Full Code Here

  public static final short SLOT_CAN = 0;

  /* NETWORK */
  @Override
  public PacketPayload getPacketPayload() {
    PacketPayload payload = super.getPacketPayload();

    if (shutdown)
      payload.append(new int[] { 1 });
    else
      payload.append(new int[] { 0 });

    return payload;
  }
View Full Code Here

    }

  }

  public void advanceSelection(int index, World world) {
    PacketPayload payload = new PacketPayload(2, 0, 0);
    payload.intPayload[0] = index;
    payload.intPayload[1] = 0;
    sendSelectionChange(payload);
  }
View Full Code Here

    payload.intPayload[1] = 0;
    sendSelectionChange(payload);
  }

  public void regressSelection(int index, World world) {
    PacketPayload payload = new PacketPayload(2, 0, 0);
    payload.intPayload[0] = index;
    payload.intPayload[1] = 1;
    sendSelectionChange(payload);
  }
View Full Code Here

    else
      inventory.regressSecondary();
  }

  public void sendSelection(EntityPlayer player) {
    PacketPayload payload = new PacketPayload(2, 0, 0);
    payload.intPayload[0] = inventory.getPrimaryIndex();
    payload.intPayload[1] = inventory.getSecondaryIndex();
    Proxies.net.sendToPlayer(new PacketUpdate(PacketIds.GUI_SELECTION, payload), player);
  }
View Full Code Here

  public PacketPayload getPacketPayload() {
    if (!ClassMap.classMappers.containsKey(this.getClass()))
      ClassMap.classMappers.put(this.getClass(), new ClassMap(this.getClass()));

    ClassMap classmap = ClassMap.classMappers.get(this.getClass());
    PacketPayload payload = new PacketPayload(classmap.intSize, classmap.floatSize, classmap.stringSize);

    try {
      classmap.setData(this, payload.intPayload, payload.floatPayload, payload.stringPayload, new IndexInPayload(0, 0, 0));
    } catch (Exception ex) {
      ex.printStackTrace();
View Full Code Here

  public void clearRecipe() {
    sendRecipeClick(0, tile.getMemory().capacity);
  }

  public void sendRecipeClick(int mouseButton, int recipeIndex) {
    PacketPayload payload = new PacketPayload(2, 0, 0);
    payload.intPayload[0] = mouseButton;
    payload.intPayload[1] = recipeIndex;
    PacketUpdate packet = new PacketUpdate(PacketIds.GUI_SELECTION_CHANGE, payload);
    Proxies.net.sendToServer(packet);
  }
View Full Code Here

TOP

Related Classes of forestry.core.network.PacketPayload

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.