@Override
  public void toBytes(ByteBuf buf) {

    buf.writeDouble(x);
    buf.writeDouble(y);
    buf.writeDouble(z);
  }
 @Override
 public void toBytes(ByteBuf buf) {
   buf.writeDouble(this.posX);
   buf.writeDouble(this.posY);
   buf.writeDouble(this.posZ);
   buf.writeFloat(this.strength);
   buf.writeBoolean(this.showParticles);
 }
Example #3
0
 public ByteBuf encode(ByteBuf buf, PositionRotationMessage message) throws IOException {
   buf.writeDouble(message.getX());
   buf.writeDouble(message.getY());
   buf.writeDouble(message.getZ());
   buf.writeFloat(message.getRotation());
   buf.writeFloat(message.getPitch());
   buf.writeBoolean(message.isOnGround());
   return buf;
 }
 @Override
 public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
   buffer.writeInt(dim);
   buffer.writeInt(x);
   buffer.writeInt(y);
   buffer.writeInt(z);
   buffer.writeDouble(rotation);
   buffer.writeDouble(scale);
 }
Example #5
0
 public ByteBuf encode(ByteBuf buf, PlayerPositionLookMessage message) throws IOException {
   buf.writeDouble(message.getX());
   buf.writeDouble(message.getY());
   buf.writeDouble(message.getHeadY());
   buf.writeDouble(message.getZ());
   buf.writeFloat(message.getYaw());
   buf.writeFloat(message.getPitch());
   buf.writeBoolean(message.getOnGround());
   return buf;
 }
  @Override
  public void encode(ByteBuf buf) {
    buf.writeDouble(this.location.getX());
    buf.writeDouble(this.location.getY());
    buf.writeDouble(this.location.getZ());

    buf.writeFloat(this.location.getYaw());
    buf.writeFloat(this.location.getPitch());

    buf.writeByte((int) this.flags);
  }
Example #7
0
  @Override
  public void toBytes(ByteBuf buf) {
    buf.writeInt(posX);
    buf.writeInt(posY);
    buf.writeInt(posZ);
    buf.writeInt(data.size());

    for (int i = 0; i < data.size(); i++) {
      Object obj = data.get(i);
      if (obj instanceof Character) {
        buf.writeByte(0x00);
        buf.writeChar((Character) obj);
      } else if (obj instanceof String) {
        buf.writeByte(0x01);
        writeString(buf, (String) obj);
      } else if (obj instanceof Float) {
        buf.writeByte(0x02);
        buf.writeFloat((Float) obj);
      } else if (obj instanceof Double) {
        buf.writeByte(0x03);
        buf.writeDouble((Double) obj);
      } else if (obj instanceof Byte) {
        buf.writeByte(0x04);
        buf.writeByte((Byte) obj);
      } else if (obj instanceof Long) {
        buf.writeByte(0x05);
        buf.writeLong((Long) obj);
      } else {
        buf.writeByte(0x0F);
        buf.writeInt((Integer) obj);
      }
    }
  }
 @Override
 public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) throws IOException {
   writeDimensionPosToBuffer(buffer, target);
   buffer.writeInt(type);
   buffer.writeDouble(duration);
   encodePrimitiveArrayInto(buffer, args);
 }
 @Override
 public void toBytes(ByteBuf buf) {
   buf.writeInt(vehicleID);
   buf.writeDouble(posX);
   buf.writeDouble(posY);
   buf.writeDouble(posZ);
   buf.writeDouble(motX);
   buf.writeDouble(motY);
   buf.writeDouble(motZ);
   buf.writeFloat(yaw);
   buf.writeFloat(pitch);
   buf.writeFloat(roll);
   buf.writeDouble(throttle);
   buf.writeFloat(steeringAngle);
   buf.writeInt(ticksSinceEntered);
   buf.writeInt(ticksSinceLeft);
 }
 @Override
 public void writeConfig(ByteBuf dataStream) throws IOException {
   dataStream.writeDouble(generators.advancedSolarGeneration);
   dataStream.writeDouble(generators.bioGeneration);
   dataStream.writeDouble(generators.heatGeneration);
   dataStream.writeDouble(generators.heatGenerationLava);
   dataStream.writeDouble(generators.heatGenerationNether);
   dataStream.writeDouble(generators.solarGeneration);
   dataStream.writeDouble(generators.windGenerationMin);
   dataStream.writeDouble(generators.windGenerationMax);
   dataStream.writeInt(generators.windGenerationMinY);
   dataStream.writeInt(generators.windGenerationMaxY);
 }
 public void setDouble(double value) {
   data.writeDouble(value);
 }
 @Override
 public ByteBuf writeDouble(double var1) {
   return a.writeDouble(var1);
 }
Example #13
0
 /**
  * Writes this vector to the packet byte buffer.
  *
  * @param buf Buffer to write to
  */
 public void toBytes(ByteBuf buf) {
   buf.writeDouble(x());
   buf.writeDouble(y());
   buf.writeDouble(z());
 }
Example #14
0
 /**
  * Appends the specified {@code double} to the end of the Buffer. The buffer will expand as
  * necessary to accommodate any bytes written.
  *
  * <p>Returns a reference to {@code this} so multiple operations can be appended together.
  */
 public Buffer appendDouble(double d) {
   buffer.writeDouble(d);
   return this;
 }
Example #15
0
 @Override
 public void writeSpawnData(ByteBuf data) {
   data.writeDouble(posX);
   data.writeDouble(posY);
   data.writeDouble(posZ);
 }
 @Override
 public MessageBuffer<ByteBuf> writeDouble(double value) {
   buffer.writeDouble(value);
   return this;
 }
Example #17
0
 @Override
 public ByteBuf writeDouble(double value) {
   return buf.writeDouble(value);
 }