List of usage examples for io.netty.buffer ByteBuf writeBoolean
public abstract ByteBuf writeBoolean(boolean value);
From source file:mal.carbonization.network.MultiblockFurnaceMessageServer.java
License:Open Source License
@Override public void toBytes(ByteBuf buf) { buf.writeInt(xpos);//from w w w . ja v a 2 s .c o m buf.writeInt(ypos); buf.writeInt(zpos); buf.writeInt(xsize); buf.writeInt(ysize); buf.writeInt(zsize); buf.writeBoolean(useInventory); buf.writeByte(offset.length); for (int i = 0; i < offset.length; i++) buf.writeInt(offset[i]); buf.writeBoolean(properlyActivated); buf.writeInt(oreCapacity); buf.writeInt(slagTank); buf.writeByte(componentTiers.length); for (int i = 0; i < componentTiers.length; i++) buf.writeDouble(componentTiers[i]); if (useInventory) { byte[] b = ItemStacktoByteArray(inputStacks); buf.writeInt(b.length); buf.writeInt(inputStacks.length); buf.writeBytes(b); byte[] bb = ItemStacktoByteArray(outputStacks); buf.writeInt(bb.length); buf.writeInt(outputStacks.length); buf.writeBytes(bb); } buf.writeInt(fuelStack); buf.writeInt(numQueueJobs); buf.writeInt(grossCookTime); buf.writeInt(grossMaxCookTime); buf.writeInt(maxFuelCapacity); buf.writeBoolean(passFuel); buf.writeInt(queue.size()); for (MultiblockWorkQueueItem item : queue) { byte[] qb = queueItemtoBytes(item); buf.writeInt(qb.length); buf.writeBytes(qb); } try { ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(byteOut); out.writeObject(oreSlagInQueue); byte[] ob = byteOut.toByteArray(); buf.writeInt(ob.length); buf.writeBytes(ob); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
From source file:mal.carbonization.network.MultiblockInitMessage.java
License:Open Source License
@Override public void toBytes(ByteBuf buf) { buf.writeInt(xpos);//w w w.j a v a 2 s .co m buf.writeInt(ypos); buf.writeInt(zpos); buf.writeInt(xdiff); buf.writeInt(ydiff); buf.writeInt(zdiff); buf.writeBoolean(activated); byte[] b = type.getBytes(); buf.writeInt(b.length); buf.writeBytes(b); }
From source file:mal.carbonization.network.StructureBlockMessage.java
License:Open Source License
@Override public void toBytes(ByteBuf buf) { buf.writeInt(xpos);/*from w w w. j a v a 2 s . c o m*/ buf.writeInt(ypos); buf.writeInt(zpos); buf.writeInt(mx); buf.writeInt(my); buf.writeInt(mz); buf.writeInt(baseMaterial); buf.writeInt(secondaryMaterial); buf.writeInt(purpose); buf.writeBoolean(loaded); }
From source file:mal.carbonization.network.TunnelBoreMessageClient.java
License:Open Source License
@Override public void toBytes(ByteBuf buf) { buf.writeInt(xpos); buf.writeInt(ypos); buf.writeInt(zpos); buf.writeBoolean(hollowScaffold); }
From source file:mal.carbonization.network.TunnelBoreMessageServer.java
License:Open Source License
@Override public void toBytes(ByteBuf buf) { buf.writeInt(xpos);// w ww . ja v a 2 s . co m buf.writeInt(ypos); buf.writeInt(zpos); buf.writeInt(xSize); buf.writeInt(ySize); buf.writeInt(facing); buf.writeInt(cycles); buf.writeInt(maxDigCooldown); buf.writeInt(digCooldown); buf.writeInt(fuelStack); buf.writeInt(maxFuel); buf.writeBoolean(digSilkTouch); buf.writeBoolean(digIgnoreHardness); buf.writeInt(digFortuneLevel); buf.writeBoolean(hollowScaffold); buf.writeDouble(fuelMultiplyer); buf.writeBoolean(fixedPosition); buf.writeBoolean(voidUpgrade); buf.writeBoolean(inventory); if (inventory) { byte[] i = ItemStacktoByteArray(upgradeSlots); buf.writeInt(i.length); buf.writeInt(upgradeSlots.length); buf.writeBytes(i); byte[] o = ItemStacktoByteArray(dimensionStack); buf.writeInt(o.length); buf.writeInt(dimensionStack.length); buf.writeBytes(o); } }
From source file:matteroverdrive.data.MinimapEntityInfo.java
License:Open Source License
public MinimapEntityInfo writeToBuffer(ByteBuf buf) { buf.writeBoolean(isAttacking); buf.writeInt(entityID); return this; }
From source file:matteroverdrive.entity.monster.EntityRougeAndroidMob.java
License:Open Source License
@Override public void writeSpawnData(ByteBuf buffer) { buffer.writeByte(level);/*w w w . j a va2 s . c o m*/ buffer.writeBoolean(legendary); buffer.writeInt(visorColor); buffer.writeBoolean(hasTeam()); if (hasTeam()) { ByteBufUtils.writeUTF8String(buffer, getTeam().getRegisteredName()); } }
From source file:matteroverdrive.network.packet.bi.PacketStarLoading.java
License:Open Source License
@Override public void toBytes(ByteBuf buf) { buf.writeInt(quadrantID);// w w w . j a v a 2 s. c o m buf.writeInt(starID); buf.writeBoolean(star != null); if (star != null) { star.writeToBuffer(buf); } }
From source file:matteroverdrive.network.packet.bi.PacketWeaponTick.java
License:Open Source License
@Override public void toBytes(ByteBuf buf) { buf.writeLong(timestamp);//w w w . j a v a 2s. co m buf.writeBoolean(plasmaShot != null); if (plasmaShot != null) { plasmaShot.toBytes(buf); } }
From source file:matteroverdrive.network.packet.server.PacketManageConversation.java
License:Open Source License
@Override public void toBytes(ByteBuf buf) { buf.writeInt(npcID); buf.writeBoolean(start); }