예제 #1
0
        public INbtTag ReadNbtTag()
        {
            var reader = NbtReader.Create(source_);

            if (reader.MoveNext())
            {
                return(reader.CurrentValue);
            }

            return(null);
        }
예제 #2
0
 static void Main(string[] args)
 {
     using (var file = File.OpenRead(@"C:\Users\Rob\Documents\Visual Studio 2017\Projects\MapGenExploration\ConsoleApp\bin\Debug\pendingticks-15.15.dat"))
     {
         var reader = NbtReader.Create(file);
         while (reader.MoveNext())
         {
             var value = reader.CurrentValue;
             ExploreValue(value, 0);
         }
     }
 }
예제 #3
0
        private static INbtDictionary DictionaryTagFromBuffer(byte[] buffer)
        {
            using (var ms = new MemoryStream(buffer))
            {
                var reader = NbtReader.Create(ms);
                if (!reader.MoveNext())
                {
                    return(null);
                }

                return(reader.CurrentValue.AsDictionary());
            }
        }
예제 #4
0
        private static List <INbtDictionary> DictionaryTagListFromBuffer(byte[] buffer)
        {
            List <INbtDictionary> result = new List <INbtDictionary>();

            using (var ms = new MemoryStream(buffer))
            {
                while (ms.Position < ms.Length)
                {
                    var reader = NbtReader.Create(ms);
                    if (!reader.MoveNext())
                    {
                        break;
                    }

                    result.Add(reader.CurrentValue.AsDictionary());
                }
            }

            return(result);
        }