Example usage for io.netty.buffer ByteBufOutputStream writeDouble

List of usage examples for io.netty.buffer ByteBufOutputStream writeDouble

Introduction

In this page you can find the example usage for io.netty.buffer ByteBufOutputStream writeDouble.

Prototype

@Override
    public void writeDouble(double v) throws IOException 

Source Link

Usage

From source file:de.sanandrew.mods.claysoldiers.network.packet.PacketParticleFX.java

License:Creative Commons License

@Override
public void writeData(ByteBufOutputStream stream, Tuple dataTuple) throws IOException {
    EnumParticleFx fxType = (EnumParticleFx) dataTuple.getValue(0);
    stream.writeByte(fxType.ordinalByte());
    switch (fxType) {
    case FX_BREAK: // FALL_THROUGH
    case FX_SOLDIER_DEATH: // FALL_THROUGH
    case FX_DIGGING:
        stream.writeDouble((double) dataTuple.getValue(1));
        stream.writeDouble((double) dataTuple.getValue(2));
        stream.writeDouble((double) dataTuple.getValue(3));
        stream.writeUTF((String) dataTuple.getValue(4));
        break;/*from  w w  w.j  ava 2s  .  c  o  m*/
    case FX_CRIT: // FALL_THROUGH
    case FX_SHOCKWAVE: // FALL_THROUGH
    case FX_MAGMAFUSE:
        stream.writeDouble((double) dataTuple.getValue(1));
        stream.writeDouble((double) dataTuple.getValue(2));
        stream.writeDouble((double) dataTuple.getValue(3));
        break;
    case FX_HORSE_DEATH: // FALL_THROUGH
    case FX_BUNNY_DEATH: // FALL_THROUGH
    case FX_TURTLE_DEATH:
        stream.writeDouble((double) dataTuple.getValue(1));
        stream.writeDouble((double) dataTuple.getValue(2));
        stream.writeDouble((double) dataTuple.getValue(3));
        stream.writeByte((byte) dataTuple.getValue(4));
        break;
    case FX_SPELL:
        stream.writeDouble((double) dataTuple.getValue(1));
        stream.writeDouble((double) dataTuple.getValue(2));
        stream.writeDouble((double) dataTuple.getValue(3));
        stream.writeDouble((double) dataTuple.getValue(4));
        stream.writeDouble((double) dataTuple.getValue(5));
        stream.writeDouble((double) dataTuple.getValue(6));
        break;
    }
}

From source file:de.sanandrew.mods.enderstuffp.network.packet.PacketParticleFX.java

License:Creative Commons License

@Override
public void writeData(ByteBufOutputStream stream, Tuple dataTuple) throws IOException {
    stream.writeByte((byte) dataTuple.getValue(0));
    stream.writeDouble((double) dataTuple.getValue(1));
    stream.writeDouble((double) dataTuple.getValue(2));
    stream.writeDouble((double) dataTuple.getValue(3));
    Tuple.writeToByteBufStream((Tuple) dataTuple.getValue(4), stream);
}