Forgot to add these two days ago

This commit is contained in:
Norbi Peti 2020-01-02 00:53:38 +01:00
parent 609e4e96e3
commit 93b272f791
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
2 changed files with 50 additions and 0 deletions

16
GCMCTest/GCMCTest.csproj Normal file
View file

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="fNbt" Version="0.6.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GCMC\GCMC.csproj" />
</ItemGroup>
</Project>

34
GCMCTest/Program.cs Normal file
View file

@ -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);
}
}
}
}
}