Example usage for io.netty.buffer ByteBuf readDouble

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

Introduction

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

Prototype

public abstract double readDouble();

Source Link

Document

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

Usage

From source file:buildcraft.factory.TileQuarry.java

License:Minecraft Mod Public

@Override
public void readData(ByteBuf stream) {
    super.readData(stream);
    box.readData(stream);/*from ww  w  . j  a v a  2s.  co  m*/
    targetX = stream.readInt();
    targetY = stream.readUnsignedShort();
    targetZ = stream.readInt();
    headPosX = stream.readDouble();
    headPosY = stream.readDouble();
    headPosZ = stream.readDouble();
    speed = stream.readFloat();
    headTrajectory = stream.readFloat();
    int flags = stream.readUnsignedByte();
    stage = Stage.values()[flags & 0x07];
    movingHorizontally = (flags & 0x10) != 0;
    movingVertically = (flags & 0x20) != 0;

    createUtilsIfNeeded();

    if (arm != null) {
        arm.setHead(headPosX, headPosY, headPosZ);
        arm.updatePosition();
    }
}

From source file:cn.liutils.api.player.state.StateLockPosition.java

License:Open Source License

@Override
protected void readBytes(ByteBuf buf) {
    posX = buf.readDouble();
    posY = buf.readDouble();
    posZ = buf.readDouble();
}

From source file:com.bluepowermod.network.message.LocationDoublePacket.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {

    x = buf.readDouble();
    y = buf.readDouble();
    z = buf.readDouble();
}

From source file:com.bluepowermod.part.tube.TubeStack.java

License:Open Source License

public static TubeStack loadFromPacket(ByteBuf buf) {

    TubeStack stack = new TubeStack(ByteBufUtils.readItemStack(buf),
            ForgeDirection.getOrientation(buf.readByte()), TubeColor.values()[buf.readByte()]);
    stack.speed = buf.readDouble();
    stack.progress = buf.readDouble();/*w w  w. ja  va 2  s  .  c o m*/
    return stack;
}

From source file:com.builtbroken.atomic.lib.transform.rotation.EulerAngle.java

@Deprecated
public void readByteBuf(ByteBuf data) {
    yaw = data.readDouble();
    pitch = data.readDouble();
    roll = data.readDouble();
}

From source file:com.builtbroken.atomic.lib.transform.rotation.EulerAngle.java

@Override
public EulerAngle readBytes(ByteBuf data) {
    yaw = data.readDouble();
    pitch = data.readDouble();/*from w  ww.ja v  a2s .c om*/
    roll = data.readDouble();
    return this;
}

From source file:com.builtbroken.atomic.network.packet.client.PacketSpawnParticle.java

@Override
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
    dim = buffer.readInt();/*  ww  w  .j av  a 2  s  .co m*/
    x = buffer.readDouble();
    y = buffer.readDouble();
    z = buffer.readDouble();
    particle = ByteBufUtils.readUTF8String(buffer);
}

From source file:com.builtbroken.grappling.network.packets.PacketUpdateLocation.java

@Override
public void read(ByteBuf buffer) {
    x = buffer.readDouble();
    y = buffer.readDouble();
    z = buffer.readDouble();
}

From source file:com.crowsofwar.avatar.common.network.packets.PacketCParticles.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    particle = ParticleType.lookup(buf.readInt());
    minimum = buf.readInt();/*from   w ww .j ava 2  s.c  o m*/
    maximum = buf.readInt();
    x = buf.readDouble();
    y = buf.readDouble();
    z = buf.readDouble();
    maxVelocityX = buf.readDouble();
    maxVelocityY = buf.readDouble();
    maxVelocityZ = buf.readDouble();
}

From source file:com.crowsofwar.gorecore.util.Vector.java

License:Open Source License

/**
 * Creates a new vector from the packet information in the byte buffer.
 * Vectors should be encoded using the non-static {@link #toBytes(ByteBuf)
 * toBytes}./* w ww .  j av  a  2 s .  c  o m*/
 * 
 * @param buf
 *            Buffer to read from
 * 
 * @see #toBytes(ByteBuf)
 */
public static Vector fromBytes(ByteBuf buf) {
    return new Vector(buf.readDouble(), buf.readDouble(), buf.readDouble());
}