@Override
  public void readData(DataInputStream in) throws IOException {
    entityId = in.readInt();

    velocityX = in.readShort() / 8000D;
    velocityY = in.readShort() / 8000D;
    velocityZ = in.readShort() / 8000D;
  }
  @Override
  public void readData(DataInputStream in) throws IOException {
    x = in.readInt();
    z = in.readInt();
    biomes = in.readBoolean();
    bitmask = in.readShort();
    additionalBitmask = in.readShort();
    int tempLength = in.readInt();

    byte[] compressedChunkData = new byte[tempLength];
    in.readFully(compressedChunkData, 0, tempLength);
    int i = 0;

    for (int j = 0; j < 16; j++) i += bitmask >> j & 1;

    int k = 12288 * i;

    if (biomes) k += 256;

    chunkData = new byte[k];
    Inflater inflater = new Inflater();
    inflater.setInput(compressedChunkData, 0, tempLength);

    try {
      inflater.inflate(chunkData);
    } catch (DataFormatException dataformatexception) {
      chunkData = null;
    } catch (OutOfMemoryError error) {
      System.gc();
      try {
        inflater.end();

        inflater = new Inflater();
        inflater.setInput(compressedChunkData, 0, tempLength);

        inflater.inflate(chunkData);
      } catch (DataFormatException dataformatexception) {
        chunkData = null;
      } catch (OutOfMemoryError error2) {
        chunkData = null;
      }
    } finally {
      inflater.end();
    }
  }
 @Override
 public void readData(DataInputStream in) throws IOException {
   string1 = readString(in, 16);
   string2 = readString(in, 32);
   byte1 = in.readByte();
 }
Example #4
0
 public void readData(DataInputStream in) throws IOException {
   entityId = in.readInt();
 }
 public void readData(DataInputStream in) throws IOException {
   entityId = in.readInt();
   effectId = in.readByte();
   effectAmp = in.readByte();
   duration = in.readShort();
 }
 public void readData(DataInputStream in) throws IOException {
   otherTime = in.readLong();
   time = in.readLong();
 }