Example usage for io.netty.buffer ByteBuf writeBoolean

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

Introduction

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

Prototype

public abstract ByteBuf writeBoolean(boolean value);

Source Link

Document

Sets the specified boolean at the current writerIndex and increases the writerIndex by 1 in this buffer.

Usage

From source file:minechess.common.network.PacketPlaySound.java

License:LGPL

@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
    super.encodeInto(ctx, buffer);
    ByteBufUtils.writeUTF8String(buffer, sound);
    buffer.writeFloat(volume);//w  w w. j  a v  a  2  s  .c o m
    buffer.writeFloat(pitch);
    buffer.writeBoolean(bool);
}

From source file:net.doubledoordev.inventorylock.network.Reply.java

License:Open Source License

@Override
public void toBytes(ByteBuf buf) {
    buf.writeLong(key.toLong());/*from   w ww . jav a  2  s .  c  o m*/
    buf.writeInt(value.size());
    for (String name : value)
        ByteBufUtils.writeUTF8String(buf, name);
    buf.writeBoolean(pub);
}

From source file:net.tridentsdk.packets.play.out.PacketPlayOutAttachEntity.java

License:Open Source License

@Override
public void encode(ByteBuf buf) {
    buf.writeInt(this.entityId); // Well, that's a first
    buf.writeInt(this.vehicleId); // AGAIN
    // rip in peace varints

    buf.writeBoolean(this.leash);
}

From source file:net.tridentsdk.packets.play.out.PacketPlayOutChunkData.java

License:Open Source License

@Override
public void encode(ByteBuf buf) {
    buf.writeInt(this.chunkLocation.getX());
    buf.writeInt(this.chunkLocation.getZ());

    buf.writeBoolean(this.continuous);
    buf.writeByte((int) this.primaryBitMap);

    Codec.writeVarInt32(buf, this.data.length);
    buf.writeBytes(this.data);
}

From source file:net.tridentsdk.packets.play.out.PacketPlayOutConfirmTransaction.java

License:Open Source License

@Override
public void encode(ByteBuf buf) {
    buf.writeInt(this.windowId);
    buf.writeShort((int) this.actionNumber);
    buf.writeBoolean(this.accepted);
}

From source file:net.tridentsdk.packets.play.out.PacketPlayOutEffect.java

License:Open Source License

@Override
public void encode(ByteBuf buf) {
    buf.writeInt(this.effectId);

    new Position(this.loc).write(buf);

    buf.writeInt(this.data);
    buf.writeBoolean(this.playSound);
}

From source file:net.tridentsdk.packets.play.out.PacketPlayOutEntityEffect.java

License:Open Source License

@Override
public void encode(ByteBuf buf) {
    Codec.writeVarInt32(buf, this.entityId);

    buf.writeByte((int) this.effectId);
    buf.writeByte((int) this.amplifier);
    Codec.writeVarInt64(buf, this.duration);

    buf.writeBoolean(this.hideParticles);
}

From source file:net.tridentsdk.packets.play.out.PacketPlayOutEntityLook.java

License:Open Source License

@Override
public void encode(ByteBuf buf) {
    Codec.writeVarInt32(buf, this.entityId);

    buf.writeByte((int) this.location.getYaw());
    buf.writeByte((int) this.location.getPitch());

    buf.writeBoolean(this.onGround);
}

From source file:net.tridentsdk.packets.play.out.PacketPlayOutEntityRelativeMove.java

License:Open Source License

@Override
public void encode(ByteBuf buf) {
    Codec.writeVarInt32(buf, this.entityId);

    buf.writeInt((int) this.difference.getX() * 32);
    buf.writeInt((int) this.difference.getY() * 32);
    buf.writeInt((int) this.difference.getZ() * 32);

    buf.writeBoolean(this.onGround);
}

From source file:net.tridentsdk.packets.play.out.PacketPlayOutEntityTeleport.java

License:Open Source License

@Override
public void encode(ByteBuf buf) {
    Codec.writeVarInt32(buf, this.entityId);

    buf.writeInt((int) this.location.getX() * 32);
    buf.writeInt((int) this.location.getY() * 32);
    buf.writeInt((int) this.location.getZ() * 32);

    buf.writeByte((int) this.location.getYaw());
    buf.writeByte((int) this.location.getPitch());

    buf.writeBoolean(this.onGround);
}