protected override void EncodeImpl(sul.Utils.Buffer _buffer) { _buffer.WriteBigEndianShort(id); if (id > 0) { _buffer.WriteUbyte(count); } if (id > 0) { _buffer.WriteBigEndianUshort(damage); } if (id > 0) { _buffer.WriteBytes(nbt); } }
protected override void EncodeImpl(sul.Utils.Buffer _buffer) { _buffer.WriteVaruint(sections.Length); foreach (Section sectionsChild in sections) { sectionsChild.EncodeBody(_buffer); } foreach (ushort heightsChild in heights) { _buffer.WriteBigEndianUshort(heightsChild); } foreach (byte biomesChild in biomes) { _buffer.WriteUbyte(biomesChild); } _buffer.WriteVaruint(borders.Length); _buffer.WriteBytes(borders); _buffer.WriteVaruint(extraData.Length); foreach (ExtraData extraDataChild in extraData) { extraDataChild.EncodeBody(_buffer); } _buffer.WriteBytes(blockEntities); }
protected override void EncodeImpl(sul.Utils.Buffer _buffer) { _buffer.WriteUbyte(info); _buffer.WriteBigEndianUshort(length); if ((info & 0x7F) >= 64) { _buffer.WriteLittleEndianTriad(messageIndex); } if ((info & 0x7F) >= 96) { _buffer.WriteLittleEndianTriad(orderIndex); } if ((info & 0x7F) >= 96) { _buffer.WriteUbyte(orderChannel); } if ((info & 0x10) != 0) { split.EncodeBody(_buffer); } _buffer.WriteBytes(payload); }
protected override void EncodeImpl(sul.Utils.Buffer _buffer) { _buffer.WriteUbyte(type); if (type == 4) { _buffer.WriteBigEndianUint(ipv4); } if (type == 6) { foreach (byte ipv6Child in ipv6) { _buffer.WriteUbyte(ipv6Child); } } if (type == 6) { foreach (byte unknown3Child in unknown3) { _buffer.WriteUbyte(unknown3Child); } } _buffer.WriteBigEndianUshort(port); }
protected override void EncodeImpl(sul.Utils.Buffer _buffer) { _buffer.WriteBigEndianUint(count); _buffer.WriteBigEndianUshort(id); _buffer.WriteBigEndianUint(order); }