List of usage examples for io.netty.buffer ByteBuf readBoolean
public abstract boolean readBoolean();
From source file:org.blockartistry.DynSurround.network.PacketDisplayFootprint.java
License:MIT License
@Override public void fromBytes(@Nonnull final ByteBuf buf) { this.locus = new Locus(buf); this.rotation = buf.readFloat(); this.isRightFoot = buf.readBoolean(); }
From source file:org.blockartistry.DynSurround.network.PacketEnvironment.java
License:MIT License
@Override public void fromBytes(@Nonnull final ByteBuf buf) { this.inVillage = buf.readBoolean(); }
From source file:org.blockartistry.DynSurround.network.PacketHealthChange.java
License:MIT License
@Override public void fromBytes(@Nonnull final ByteBuf buf) { this.entityId = buf.readInt(); this.posX = buf.readFloat(); this.posY = buf.readFloat(); this.posZ = buf.readFloat(); this.isCritical = buf.readBoolean(); this.amount = buf.readInt(); }
From source file:org.blockartistry.DynSurround.network.PacketSpeechBubble.java
License:MIT License
@Override public void fromBytes(@Nonnull final ByteBuf buf) { this.entityId = buf.readInt(); this.message = ByteBufUtils.readUTF8String(buf); this.translate = buf.readBoolean(); }
From source file:org.blockartistry.DynSurround.network.PacketThunder.java
License:MIT License
@Override public void fromBytes(@Nonnull final ByteBuf buf) { this.dimension = buf.readShort(); this.doFlash = buf.readBoolean(); final int x = buf.readInt(); final int y = buf.readInt(); final int z = buf.readInt(); this.pos = new BlockPos(x, y, z); }
From source file:org.blockartistry.mod.DynSurround.network.PacketHealthChange.java
License:MIT License
@Override public void fromBytes(final ByteBuf buf) { this.entityId = new UUID(buf.readLong(), buf.readLong()); this.posX = buf.readFloat(); this.posY = buf.readFloat(); this.posZ = buf.readFloat(); this.isCritical = buf.readBoolean(); this.amount = buf.readInt(); }
From source file:org.evilco.mc.defense.common.network.DefenseStationRegisterUserPacket.java
License:Apache License
/** * Constructs a new DefenseStationRegisterUserPacket from a serialized packet buffer. * @param buffer The packet buffer./*from ww w. j av a 2s. c o m*/ */ public DefenseStationRegisterUserPacket(ByteBuf buffer) { super(buffer); // read coordinates this.xCoord = buffer.readInt(); this.yCoord = buffer.readInt(); this.zCoord = buffer.readInt(); // read mode this.blacklist = buffer.readBoolean(); // read length int length = buffer.readShort(); // create buffer byte[] usernameRaw = new byte[length]; // read buffer buffer.readBytes(usernameRaw); // convert string this.username = new String(usernameRaw, Charsets.UTF_8); }
From source file:org.opendaylight.protocol.bgp.evpn.impl.attributes.PMSITunnelAttributeHandler.java
License:Open Source License
@Override public void parseAttribute(@Nonnull final ByteBuf buffer, @Nonnull final AttributesBuilder builder) { if (!buffer.isReadable()) { return;/*from w w w . java2s . com*/ } final PmsiTunnelBuilder pmsiTunnelBuilder = new PmsiTunnelBuilder(); pmsiTunnelBuilder.setLeafInformationRequired(buffer.readBoolean()); final int tunnelType = buffer.readUnsignedByte(); parseMpls(pmsiTunnelBuilder, buffer); final TunnelIdentifier tunnelIdentifier = this.tunnelIdentifierHandler.parse(tunnelType, buffer); if (tunnelIdentifier != null) { pmsiTunnelBuilder.setTunnelIdentifier(tunnelIdentifier); } builder.addAugmentation(PmsiTunnelAugmentation.class, new PmsiTunnelAugmentationBuilder().setPmsiTunnel(pmsiTunnelBuilder.build()).build()); }
From source file:org.opendaylight.protocol.bgp.evpn.impl.extended.communities.ESILabelExtCom.java
License:Open Source License
@Override public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) throws BGPDocumentedException, BGPParsingException { final boolean singleActive = buffer.readBoolean(); buffer.skipBytes(RESERVED);// w w w . j a va 2 s .c o m final MplsLabel label = mplsLabelForByteBuf(buffer); return new EsiLabelExtendedCommunityCaseBuilder().setEsiLabelExtendedCommunity( new EsiLabelExtendedCommunityBuilder().setEsiLabel(label).setSingleActiveMode(singleActive).build()) .build(); }
From source file:org.opendaylight.protocol.bgp.evpn.impl.extended.communities.MACMobExtCom.java
License:Open Source License
@Override public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) throws BGPDocumentedException, BGPParsingException { final boolean isStatic = buffer.readBoolean(); buffer.skipBytes(RESERVED);/*from w w w .ja va 2 s . c om*/ final long seqNumber = buffer.readUnsignedInt(); return new MacMobilityExtendedCommunityCaseBuilder().setMacMobilityExtendedCommunity( new MacMobilityExtendedCommunityBuilder().setStatic(isStatic).setSeqNumber(seqNumber).build()) .build(); }