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:mal.carbonization.network.FuelConversionBenchMessageServer.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    xpos = buf.readInt();//from  w w  w.  ja  va2s . c om
    ypos = buf.readInt();
    zpos = buf.readInt();
    fuelState = buf.readBoolean();
    currentIndex = buf.readInt();
    craftingCooldown = buf.readInt();
    maxCooldown = buf.readInt();
    bonusYield = buf.readDouble();
    voidUpgrade = buf.readBoolean();
    ejectSide = buf.readInt();
    maxFuel = buf.readInt();
    fuelStack = buf.readInt();
    inventory = buf.readBoolean();
    if (inventory) {
        int inputsize = buf.readInt();
        int iitemcount = buf.readInt();
        byte[] inputbyte = new byte[inputsize];
        buf.readBytes(inputbyte);
        inventoryStacks = ByteArraytoItemStack(inputbyte, iitemcount);

        int outputsize = buf.readInt();
        int oitemcount = buf.readInt();
        byte[] outputbyte = new byte[outputsize];
        buf.readBytes(outputbyte);
        upgradeStacks = ByteArraytoItemStack(outputbyte, oitemcount);
    }
}

From source file:mal.carbonization.network.FurnacesMessage.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    xpos = buf.readInt();/*  w w  w  . j  a v a 2 s.  com*/
    ypos = buf.readInt();
    zpos = buf.readInt();
    facing = buf.readByte();
    metadata = buf.readInt();
    usesExtraTime = buf.readBoolean();
    isActive = buf.readBoolean();
    furnaceCookTimeMultiplyer = buf.readDouble();
    furnaceMaxCookTime = buf.readInt();
    tier = buf.readInt();
    furnaceBurnTime = buf.readInt();
    currentItemBurnTime = buf.readInt();
    furnaceCookTime = buf.readInt();

    int l = buf.readInt();
    int c = buf.readInt();
    byte[] b = new byte[l];
    buf.readBytes(b);
    inventory = ByteArraytoItemStack(b, c);
}

From source file:mal.carbonization.network.MultiblockFurnaceMessageClient.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    passFuel = buf.readBoolean();
    xpos = buf.readInt();
    ypos = buf.readInt();
    zpos = buf.readInt();
}

From source file:mal.carbonization.network.MultiblockFurnaceMessageServer.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    xpos = buf.readInt();/*from w  w w.  j av a2  s. c om*/
    ypos = buf.readInt();
    zpos = buf.readInt();
    xsize = buf.readInt();
    ysize = buf.readInt();
    zsize = buf.readInt();
    useInventory = buf.readBoolean();
    byte offsetsize = buf.readByte();
    offset = new int[offsetsize];
    for (int i = 0; i < offset.length; i++)
        offset[i] = buf.readInt();
    properlyActivated = buf.readBoolean();
    oreCapacity = buf.readInt();
    slagTank = buf.readInt();
    byte tiersize = buf.readByte();
    componentTiers = new double[tiersize];
    for (int j = 0; j < componentTiers.length; j++)
        componentTiers[j] = buf.readDouble();
    if (useInventory) {
        int l = buf.readInt();
        int c = buf.readInt();
        byte[] b = new byte[l];
        buf.readBytes(b);
        inputStacks = ByteArraytoItemStack(b, c);
        int ll = buf.readInt();
        int cc = buf.readInt();
        byte[] bb = new byte[ll];
        buf.readBytes(bb);
        outputStacks = ByteArraytoItemStack(bb, cc);
    }
    fuelStack = buf.readInt();
    numQueueJobs = buf.readInt();
    grossCookTime = buf.readInt();
    grossMaxCookTime = buf.readInt();
    maxFuelCapacity = buf.readInt();
    passFuel = buf.readBoolean();
    int queuenum = buf.readInt();
    queue = new ArrayList<MultiblockWorkQueueItem>();
    for (int i = 0; i < queuenum; i++) {
        int by = buf.readInt();
        byte[] ba = new byte[by];
        buf.readBytes(ba);
        MultiblockWorkQueueItem q = queueItemfromBytes(ba);
        if (q != null)
            queue.add(q);
    }
    try {
        int slagnum = buf.readInt();
        byte[] slagbyte = new byte[slagnum];
        buf.readBytes(slagbyte);
        ByteArrayInputStream bin = new ByteArrayInputStream(slagbyte);
        ObjectInputStream in = new ObjectInputStream(bin);
        oreSlagInQueue = (HashMap<String, Integer>) in.readObject();
    } catch (IOException e) {
        e.printStackTrace();
    } catch (ClassNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:mal.carbonization.network.MultiblockInitMessage.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    xpos = buf.readInt();/*  w ww.  ja  v a 2  s  .  co m*/
    ypos = buf.readInt();
    zpos = buf.readInt();
    xdiff = buf.readInt();
    ydiff = buf.readInt();
    zdiff = buf.readInt();
    activated = buf.readBoolean();
    int typelength = buf.readInt();
    type = new String(buf.readBytes(typelength).array());
}

From source file:mal.carbonization.network.StructureBlockMessage.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    xpos = buf.readInt();/*from   w w  w  .  j  a  va 2  s. com*/
    ypos = buf.readInt();
    zpos = buf.readInt();
    mx = buf.readInt();
    my = buf.readInt();
    mz = buf.readInt();
    baseMaterial = buf.readInt();
    secondaryMaterial = buf.readInt();
    purpose = buf.readInt();
    loaded = buf.readBoolean();
}

From source file:mal.carbonization.network.TunnelBoreMessageClient.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    xpos = buf.readInt();
    ypos = buf.readInt();
    zpos = buf.readInt();
    hollowScaffold = buf.readBoolean();
}

From source file:mal.carbonization.network.TunnelBoreMessageServer.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    xpos = buf.readInt();//from w  w w  .ja  v a  2 s. co  m
    ypos = buf.readInt();
    zpos = buf.readInt();
    xSize = buf.readInt();
    ySize = buf.readInt();
    facing = buf.readInt();
    cycles = buf.readInt();
    maxDigCooldown = buf.readInt();
    digCooldown = buf.readInt();
    fuelStack = buf.readInt();
    maxFuel = buf.readInt();
    digSilkTouch = buf.readBoolean();
    digIgnoreHardness = buf.readBoolean();
    digFortuneLevel = buf.readInt();
    hollowScaffold = buf.readBoolean();
    fuelMultiplyer = buf.readDouble();
    fixedPosition = buf.readBoolean();
    voidUpgrade = buf.readBoolean();
    inventory = buf.readBoolean();
    if (inventory) {
        int upgradeSize = buf.readInt();
        int iitemcount = buf.readInt();
        byte[] upgradebyte = new byte[upgradeSize];
        buf.readBytes(upgradebyte);
        upgradeSlots = ByteArraytoItemStack(upgradebyte, iitemcount);

        int dimensionsize = buf.readInt();
        int ditemcount = buf.readInt();
        byte[] inputbyte = new byte[dimensionsize];
        buf.readBytes(inputbyte);
        dimensionStack = ByteArraytoItemStack(inputbyte, ditemcount);
    }

}

From source file:matteroverdrive.data.MinimapEntityInfo.java

License:Open Source License

public MinimapEntityInfo readFromBuffer(ByteBuf buf) {
    isAttacking = buf.readBoolean();
    entityID = buf.readInt();
    return this;
}

From source file:matteroverdrive.entity.monster.EntityRougeAndroidMob.java

License:Open Source License

@Override
public void readSpawnData(ByteBuf additionalData) {
    setAndroidLevel(additionalData.readByte());
    setLegendary(additionalData.readBoolean());
    setVisorColor(additionalData.readInt());
    if (additionalData.readBoolean()) {
        String teamName = ByteBufUtils.readUTF8String(additionalData);
        ScorePlayerTeam team = worldObj.getScoreboard().getTeam(teamName);
        if (team != null)
            setTeam(team);//from  ww  w .ja v  a  2s  .co  m
    }
}