Example usage for io.netty.buffer ByteBuf readBoolean

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

Introduction

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

Prototype

public abstract boolean readBoolean();

Source Link

Document

Gets a boolean at the current readerIndex and increases the readerIndex by 1 in this buffer.

Usage

From source file:cn.academy.energy.msg.matrix.MsgMatGuiLoad.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    init = buf.readBoolean();
    if (init)//  w  w w.  j  a  va 2 s  .  co  m
        channel = ByteBufUtils.readUTF8String(buf);
}

From source file:cn.academy.energy.msg.matrix.ResponseChangePwd.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    successful = buf.readBoolean();
}

From source file:cn.academy.energy.msg.MsgEnergyHeartbeat.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    x = buf.readInt();/*w  w  w  .j av a 2 s.c  o  m*/
    y = buf.readInt();
    z = buf.readInt();
    energy = buf.readFloat();
    loaded = buf.readBoolean();
}

From source file:cn.academy.energy.msg.node.MsgNodeGuiLoad.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    loaded = buf.readBoolean();
    if (loaded)/*from ww w. j ava 2s.com*/
        channel = ByteBufUtils.readUTF8String(buf);
}

From source file:cn.lambdacraft.core.network.MsgKeyUsing.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    isUsing = buf.readBoolean();
}

From source file:cn.lambdacraft.mob.network.MsgSentrySync.java

License:Open Source License

@Override
public void fromBytes(ByteBuf stream) {
    xCoord = stream.readInt();/*from  w  w w  .ja va 2 s.  c  om*/
    yCoord = stream.readInt();
    zCoord = stream.readInt();
    isValid = stream.readBoolean();
    if (isValid) {
        linkX = stream.readInt();
        linkY = stream.readInt();
        linkZ = stream.readInt();
    }
}

From source file:cn.weaponmod.core.network.MessageWMKey.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    keyid = buf.readByte();
    keyDown = buf.readBoolean();
}

From source file:com.blogspot.jabelarminecraft.blocksmith.proxy.CommonProxy.java

License:Open Source License

public List<ItemStack> convertPayloadToItemStackList(ByteBuf theBuffer) {
    List<ItemStack> theList = new ArrayList();

    while (theBuffer.isReadable()) {
        int theID = theBuffer.readInt();
        int theMetadata = theBuffer.readInt();
        ItemStack theStack = new ItemStack(Item.getItemById(theID), 1, theMetadata);

        // Handle the case of mods like Tinker's Construct that use NBT instead of metadata
        boolean hasNBT = theBuffer.readBoolean();
        if (hasNBT) {
            theStack.setTagCompound(ByteBufUtils.readTag(theBuffer));
            // DEBUG
            System.out.println(/* w  ww .j a  v a  2s . c o  m*/
                    "The stack " + theStack.toString() + " has NBT = " + theStack.getTagCompound().toString());
        }

        theList.add(theStack);
    }

    // DEBUG
    System.out.println(theList.toString());

    return theList;
}

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

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {

    super.fromBytes(buf);
    stack = ByteBufUtils.readItemStack(buf);
    deleting = buf.readBoolean();
}

From source file:com.builtbroken.assemblyline.content.belt.TilePipeBelt.java

@Override
public boolean read(ByteBuf buf, int id, EntityPlayer player, PacketType type) {
    if (!super.read(buf, id, player, type)) {
        if (isServer() && id == PACKET_GUI_OPEN) {
            openGui(player, buf.readInt());
            return true;
        } else if (id == PACKET_INVENTORY) {
            readInvPacket(buf);/*from  w  w w . jav  a2  s.c o m*/
            return true;
        } else if (id == PACKET_GUI_BUTTON) {
            int buttonID = buf.readInt();
            boolean enabled = buf.readBoolean();

            if (buttonID == BUTTON_ITEM_PULL) {
                this.pullItems = enabled;
            } else if (buttonID == BUTTON_RENDER_TOP) {
                this.renderTop = enabled;
                this.shouldUpdateRender = true;
            } else if (buttonID == BUTTON_ITEM_EJECT) {
                this.shouldEjectItems = enabled;
            }
            return true;
        }
        return false;
    }
    return true;
}