diff --git a/README.md b/README.md index 50284f8..d309ede 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,18 @@ An NBT library for reading and writing NBT files/data [Nuget package](https://ww ```cs var Compound = NBTReader.ReadFile("Path to file", Endian.Little, NBTCompression.Auto); +var age = Compound.GetSubTag("Age"); + +//Retrieve value if you know what type it should be +Int32 item = SubTag.GetValue(); + +//OR +if (SubTag is NBTTagInt a) { + Assert.IsTrue(a.Value == 256, "Hello set wrong") +} + +//OR +var item = Compound.GetSubTag("Age"); ``` ## Writes to a file diff --git a/Tests/Builders/Classes/CompoundBuilderTest/CompoundBuilderTest.cs b/Tests/Builders/Classes/CompoundBuilderTest/CompoundBuilderTest.cs index 29bae84..99b41c4 100644 --- a/Tests/Builders/Classes/CompoundBuilderTest/CompoundBuilderTest.cs +++ b/Tests/Builders/Classes/CompoundBuilderTest/CompoundBuilderTest.cs @@ -17,7 +17,7 @@ public void TestBuild() { Assert.IsTrue(Out.GetSubValue("Hello") == 256, "Hello set wrong"); - ITag SubTag = Out.GetSubTag("Me.Hello"); + ITag SubTag = Out.GetSubTag("Hello"); Assert.IsTrue(SubTag.Type == NBTTagType.List, "List is wrong type"); Assert.IsTrue((NBTTagType)SubTag.GetInformation(NBTTagInformation.ListSubtype) == NBTTagType.String, "Wrong sub type");