Ver código fonte

Forgot to add these two days ago

tags/v1.0.0
NorbiPeti 4 anos atrás
pai
commit
93b272f791
Acessado por: NorbiPeti <szatmari.norbert.peter@gmail.com> ID da chave GPG: DBA4C4549A927E56
2 arquivos alterados com 50 adições e 0 exclusões
  1. +16
    -0
      GCMCTest/GCMCTest.csproj
  2. +34
    -0
      GCMCTest/Program.cs

+ 16
- 0
GCMCTest/GCMCTest.csproj Ver arquivo

@@ -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 Ver arquivo

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

Carregando…
Cancelar
Salvar