Example usage for io.netty.buffer ByteBuf readFloat

List of usage examples for io.netty.buffer ByteBuf readFloat

Introduction

In this page you can find the example usage for io.netty.buffer ByteBuf readFloat.

Prototype

public abstract float readFloat();

Source Link

Document

Gets a 32-bit floating point number at the current readerIndex and increases the readerIndex by 4 in this buffer.

Usage

From source file:net.tridentsdk.packets.play.in.PacketPlayInSteerVehicle.java

License:Open Source License

@Override
public Packet decode(ByteBuf buf) {
    this.sideways = buf.readFloat();
    this.forward = buf.readFloat();
    this.flags = buf.readUnsignedByte();

    return this;
}

From source file:net.tridentsdk.server.packets.play.in.PacketPlayInEntityInteract.java

License:Apache License

@Override
public Packet decode(ByteBuf buf) {
    this.target = Codec.readVarInt32(buf);
    this.type = InteractType.fromId(Codec.readVarInt32(buf));

    if (type == InteractType.INTERACT_AT) {
        double x = (double) buf.readFloat();
        double y = (double) buf.readFloat();
        double z = (double) buf.readFloat();
        this.location = Position.create(null, x, y, z); // TODO: Get the clients world
    }/*w  w w.  jav a  2s  . c  om*/

    return this;
}

From source file:net.tridentsdk.server.packets.play.in.PacketPlayInPlayerCompleteMove.java

License:Apache License

@Override
public Packet decode(ByteBuf buf) {
    double x = buf.readDouble();
    double y = buf.readDouble();
    double z = buf.readDouble();

    super.location = Position.create(null, x, y, z);

    this.newYaw = buf.readFloat();
    this.newPitch = buf.readFloat();

    super.onGround = buf.readBoolean();
    return this;
}

From source file:org.blockartistry.DynSurround.network.Locus.java

License:MIT License

public Locus(@Nonnull final ByteBuf buf) {
    super(buf.readInt(), buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat());
    this.entityId = buf.readInt();
}

From source file:org.blockartistry.DynSurround.network.PacketDisplayFootprint.java

License:MIT License

@Override
public void fromBytes(@Nonnull final ByteBuf buf) {
    this.locus = new Locus(buf);
    this.rotation = buf.readFloat();
    this.isRightFoot = buf.readBoolean();
}

From source file:org.blockartistry.DynSurround.network.PacketHealthChange.java

License:MIT License

@Override
public void fromBytes(@Nonnull final ByteBuf buf) {
    this.entityId = buf.readInt();
    this.posX = buf.readFloat();
    this.posY = buf.readFloat();
    this.posZ = buf.readFloat();
    this.isCritical = buf.readBoolean();
    this.amount = buf.readInt();
}

From source file:org.blockartistry.DynSurround.network.PacketWeatherUpdate.java

License:MIT License

@Override
public void fromBytes(@Nonnull final ByteBuf buf) {
    this.dimension = buf.readShort();
    this.intensity = buf.readFloat();
    this.maxIntensity = buf.readFloat();
    this.nextRainChange = buf.readInt();
    this.thunderStrength = buf.readFloat();
    this.thunderChange = buf.readInt();
    this.thunderEvent = buf.readInt();
}

From source file:org.blockartistry.mod.DynSurround.network.PacketHealthChange.java

License:MIT License

@Override
public void fromBytes(final ByteBuf buf) {
    this.entityId = new UUID(buf.readLong(), buf.readLong());
    this.posX = buf.readFloat();
    this.posY = buf.readFloat();
    this.posZ = buf.readFloat();
    this.isCritical = buf.readBoolean();
    this.amount = buf.readInt();
}

From source file:org.blockartistry.mod.DynSurround.network.PacketRainIntensity.java

License:MIT License

public void fromBytes(final ByteBuf buf) {
    this.intensity = buf.readFloat();
    this.dimension = buf.readInt();
}

From source file:org.eclipse.neoscada.protocol.iec60870.asdu.message.SetPointCommandShortFloatingPoint.java

License:Open Source License

public static SetPointCommandShortFloatingPoint parse(final ProtocolOptions options, final byte length,
        final ASDUHeader header, final ByteBuf data) {
    final InformationObjectAddress address = InformationObjectAddress.parse(options, data);

    final float value = data.readFloat();

    final byte b = data.readByte();

    final byte type = (byte) (b & 0b011111111);
    final boolean execute = !((b & 0b100000000) > 0);

    return new SetPointCommandShortFloatingPoint(header, address, value, type, execute);
}