LibMinecraft.Level.McLevelAbout.LoadSection C# (CSharp) Method

LoadSection() private method

private LoadSection ( LibNbt.NbtTag section ) : void
section LibNbt.NbtTag
return void
        internal void LoadSection(NbtTag section)
        {
            // Make sure we're passed a TAG_Compound named "About"
            if (section is NbtCompound && section.Name == "About")
            {
                NbtCompound compound = (NbtCompound) section;
                Name = compound["Name"] != null ? ((NbtString) compound["Name"]).Value : "";
                Author = compound["Author"] != null ? ((NbtString) compound["Author"]).Value : "";
                if (compound["CreatedOn"] != null &&
                    compound["CreatedOn"] is NbtLong)
                {
                    CreatedOn = new DateTime(1970, 1, 1, 0, 0, 0, 0)
                        .AddMilliseconds(((NbtLong) compound["CreatedOn"]).Value);
                }
                else
                {
                    CreatedOn = DateTime.Now;
                }
            }
        }