src/AnvilPacker/Encoder/PNbt/NbtPacker.cs
/// <summary> Encodes the added tags to the specified data writer, then discards previously added tags. </summary>
/// <param name="reset">Whether to discard colleted data (schemas and constant pools). Setting to true allows for parallel decoding.</param>
Encodes the added tags to the specified data writer, then discards previously added tags.
Encodes the added tags to the specified data writer then discards previously added tags .
public void Encode(DataWriter dw, bool reset)
        {
            var schemas = CreateSchemas();
            _lastSchemas = schemas;
            dw.WriteByte(1); 
            _stringPool.WriteTable(dw);
            Schema.Write(dw, schemas);
            dw.WriteVarUInt(_tags.Count);
            foreach (var tag in _tags) {
                WriteCompound(dw, tag, null);
            }
            _tags.Clear();
            if (reset) {
                _stringPool.Clear();
                _root = new Node(null, new SchemaField("", TagType.End));
            }
        }
public void Encode ( DataWriter dw , bool reset ) { var schemas = CreateSchemas ( ) ; _lastSchemas = schemas ; dw . WriteByte ( 1 ) ; _stringPool . WriteTable ( dw ) ; Schema . Write ( dw , schemas ) ; dw . WriteVarUInt ( _tags . Count ) ; foreach ( var tag in _tags ) { WriteCompound ( dw , tag , null ) ; } _tags . Clear ( ) ; if ( reset ) { _stringPool . Clear ( ) ; _root = new Node ( null , new SchemaField ( " " , TagType . End ) ) ; } }
Encodes the added tags to the specified data writer, then discards previously added tags.
Encodes the added tags to the specified data writer then discards previously added tags .
//version
dw
DataWriter
reset
bool
Whether to discard colleted data (schemas and constant pools). Setting to true allows for parallel decoding.
Whether to discard colleted data ( schemas and constant pools ) . Setting to true allows for parallel decoding .