From 93b272f791d81c7f7558e9d08c8b468884d4abc7 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 2 Jan 2020 00:53:38 +0100 Subject: [PATCH] Forgot to add these two days ago --- GCMCTest/GCMCTest.csproj | 16 ++++++++++++++++ GCMCTest/Program.cs | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 GCMCTest/GCMCTest.csproj create mode 100644 GCMCTest/Program.cs diff --git a/GCMCTest/GCMCTest.csproj b/GCMCTest/GCMCTest.csproj new file mode 100644 index 0000000..eb25fae --- /dev/null +++ b/GCMCTest/GCMCTest.csproj @@ -0,0 +1,16 @@ + + + + Exe + netcoreapp3.0 + + + + + + + + + + + diff --git a/GCMCTest/Program.cs b/GCMCTest/Program.cs new file mode 100644 index 0000000..b61af03 --- /dev/null +++ b/GCMCTest/Program.cs @@ -0,0 +1,34 @@ +using System; +using System.Threading.Channels; +using fNbt; +using GCMC; + +namespace GCMCTest +{ + class Program + { + static void Main(string[] args) + { + /*var nbtFile = new NbtFile(); + nbtFile.LoadFromFile("r.-1.-1.mca", NbtCompression.None, tag => + { + Console.WriteLine(tag); + return true; + }); + Console.WriteLine(nbtFile);*/ + using (var rf = new RegionFile("r.-1.-1.mca")) + { + Console.WriteLine(rf); + Console.WriteLine(rf.HasChunk(1, 2)); + Console.WriteLine(rf.LastModified + " " + rf.SizeDelta); + foreach (var br in rf.GetChunks()) + { + var nbt = new NbtFile(); + nbt.LoadFromStream(br.BaseStream, NbtCompression.AutoDetect); + Console.WriteLine(nbt); + Console.WriteLine(nbt.RootTag); + } + } + } + } +}