Package io.netty.buffer

Examples of io.netty.buffer.ByteBuf.writeFloat()


    ByteBuf buffer = Unpooled.buffer();
    VanillaByteBufUtils.writeString(buffer, message.getSoundName());
    buffer.writeInt((int) (message.getX() * 8.0f));
    buffer.writeInt((int) (message.getY() * 8.0f));
    buffer.writeInt((int) (message.getZ() * 8.0f));
    buffer.writeFloat(message.getVolume());
    buffer.writeByte((byte) (message.getPitch() * 63f));
    return buffer;
  }
}
View Full Code Here


  public ByteBuf encode(ExplosionMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer();
    buffer.writeDouble(message.getX());
    buffer.writeDouble(message.getY());
    buffer.writeDouble(message.getZ());
    buffer.writeFloat(message.getRadius());
    buffer.writeInt(message.getRecords());
    buffer.writeBytes(message.getCoordinates());
    buffer.writeFloat(0.0f); // unknown (x?)
    buffer.writeFloat(0.0f); // unknown (y?)
    buffer.writeFloat(0.0f); // unknown (z?)
View Full Code Here

    buffer.writeDouble(message.getY());
    buffer.writeDouble(message.getZ());
    buffer.writeFloat(message.getRadius());
    buffer.writeInt(message.getRecords());
    buffer.writeBytes(message.getCoordinates());
    buffer.writeFloat(0.0f); // unknown (x?)
    buffer.writeFloat(0.0f); // unknown (y?)
    buffer.writeFloat(0.0f); // unknown (z?)
    return buffer;
  }
}
View Full Code Here

    buffer.writeDouble(message.getZ());
    buffer.writeFloat(message.getRadius());
    buffer.writeInt(message.getRecords());
    buffer.writeBytes(message.getCoordinates());
    buffer.writeFloat(0.0f); // unknown (x?)
    buffer.writeFloat(0.0f); // unknown (y?)
    buffer.writeFloat(0.0f); // unknown (z?)
    return buffer;
  }
}
View Full Code Here

    buffer.writeFloat(message.getRadius());
    buffer.writeInt(message.getRecords());
    buffer.writeBytes(message.getCoordinates());
    buffer.writeFloat(0.0f); // unknown (x?)
    buffer.writeFloat(0.0f); // unknown (y?)
    buffer.writeFloat(0.0f); // unknown (z?)
    return buffer;
  }
}
View Full Code Here

  }

  @Override
  public ByteBuf encode(PlayerLookMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(9);
    buffer.writeFloat(-message.getYaw());
    buffer.writeFloat(message.getPitch());
    buffer.writeByte(message.isOnGround() ? 1 : 0);
    return buffer;
  }
}
View Full Code Here

  @Override
  public ByteBuf encode(PlayerLookMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(9);
    buffer.writeFloat(-message.getYaw());
    buffer.writeFloat(message.getPitch());
    buffer.writeByte(message.isOnGround() ? 1 : 0);
    return buffer;
  }
}
View Full Code Here

  @Override
  public ByteBuf encode(ParticleEffectMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer();
    VanillaByteBufUtils.writeString(buffer, message.getName());
    buffer.writeFloat(message.getX());
    buffer.writeFloat(message.getY());
    buffer.writeFloat(message.getZ());
    buffer.writeFloat(message.getXOffset());
    buffer.writeFloat(message.getYOffset());
    buffer.writeFloat(message.getZOffset());
View Full Code Here

  @Override
  public ByteBuf encode(ParticleEffectMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer();
    VanillaByteBufUtils.writeString(buffer, message.getName());
    buffer.writeFloat(message.getX());
    buffer.writeFloat(message.getY());
    buffer.writeFloat(message.getZ());
    buffer.writeFloat(message.getXOffset());
    buffer.writeFloat(message.getYOffset());
    buffer.writeFloat(message.getZOffset());
    buffer.writeFloat(message.getVelocity());
View Full Code Here

  }

  @Override
  public ByteBuf encode(PlayerHealthMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(11);
    buffer.writeFloat(message.getHealth());
    buffer.writeShort(message.getFood());
    buffer.writeFloat(message.getFoodSaturation());
    return buffer;
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.