Browse Source

Forgot to add these two days ago

tags/v1.0.0
NorbiPeti 5 years ago
parent
commit
93b272f791
Signed by: NorbiPeti <szatmari.norbert.peter@gmail.com> GPG Key ID: DBA4C4549A927E56
2 changed files with 50 additions and 0 deletions
  1. +16
    -0
      GCMCTest/GCMCTest.csproj
  2. +34
    -0
      GCMCTest/Program.cs

+ 16
- 0
GCMCTest/GCMCTest.csproj 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
- 0
GCMCTest/Program.cs 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);
}
}
}
}
}

Loading…
Cancel
Save