Package buildcraft.core.network.serializers

Examples of buildcraft.core.network.serializers.SerializationContext


          + actuals.length);
    }

    data.writeShort(methodIndex);

    SerializationContext context = new SerializationContext();

    for (int i = 0; i < actuals.length; ++i) {
      if (!writePrimitive(data, formals[i], actuals[i])) {
        m.mappings[i].write(data, actuals[i], context);
      }
View Full Code Here


      Object[] actuals = new Object [formals.length];

      int expectedParameters = m.hasInfo ? formals.length - 1 : formals.length;

      SerializationContext context = new SerializationContext();

      for (int i = 0; i < expectedParameters; ++i) {
        if (!readPrimitive(data, formals[i], actuals, i)) {
          actuals [i] = m.mappings [i].read (data, actuals [i], context);
        }
View Full Code Here

    dirty = false;
  }

  public void writeData(ByteBuf data) {
    try {
      SerializationContext context = new SerializationContext();
      ClassMapping.get(this.getClass()).write(data, this, context);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    }
  }

  public void readData(ByteBuf data) {
    try {
      SerializationContext context = new SerializationContext();
      ClassMapping.get(this.getClass()).read(data, this, context);
      dirty = true;
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

  public PacketPayload toPayload(final TileEntity tile) {
    return new PacketPayload(new PacketPayload.StreamWriter() {
      @Override
      public void writeData(ByteBuf data) {
        try {
          SerializationContext context = new SerializationContext();
          rootMappings[0].write(data, tile, context);
        } catch (IllegalArgumentException e) {
          e.printStackTrace();
        } catch (IllegalAccessException e) {
          e.printStackTrace();
View Full Code Here

    return new PacketPayload(new PacketPayload.StreamWriter() {
      @Override
      public void writeData(ByteBuf data) {
          for (int i = 0; i < rootMappings.length; ++i) {
            try {
              SerializationContext context = new SerializationContext();
              rootMappings[0].write(data, obj [i], context);
            } catch (IllegalArgumentException e) {
              e.printStackTrace();
            } catch (IllegalAccessException e) {
              e.printStackTrace();
View Full Code Here

  public void fromPayload(TileEntity tile, PacketPayload packet) {
    try {
      ByteBuf data = packet.stream;

      SerializationContext context = new SerializationContext();
      rootMappings[0].read(data, tile, context);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

  public void fromPayload(Object[] obj, PacketPayload packet) {
    try {
      ByteBuf data = packet.stream;

      for (int i = 0; i < rootMappings.length; ++i) {
        SerializationContext context = new SerializationContext();
        rootMappings[i].read(data, obj[i], context);
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

TOP

Related Classes of buildcraft.core.network.serializers.SerializationContext

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.