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

LoadSection() private method

private LoadSection ( NbtTag section ) : void
section NbtTag
return void
        internal void LoadSection(NbtTag section)
        {
            // Make sure we're passed a TAG_Compound named "Environment"
            if (section is NbtCompound && section.Name == "Environment")
            {
                NbtCompound compound = (NbtCompound) section;
                SurroundingGroundHeight = compound["SurroundingGroundHeight"] != null
                                              ? ((NbtShort) compound["SurroundingGroundHeight"]).Value
                                              : (short) 0;
                SurroundingGroundType = compound["SurroundingGroundType"] != null
                                            ? (McBlock) ((NbtByte) compound["SurroundingGroundType"]).Value
                                            : 0x00;
                SurroundingWaterHeight = compound["SurroundingWaterHeight"] != null
                                             ? ((NbtShort) compound["SurroundingWaterHeight"]).Value
                                             : (short) 0;
                SurroundingWaterType = compound["SurroundingWaterType"] != null
                                           ? (McBlock) ((NbtByte) compound["SurroundingWaterType"]).Value
                                           : 0x00;
                CloudHeight = compound["CloudHeight"] != null
                                  ? ((NbtShort) compound["CloudHeight"]).Value
                                  : (short) 0;
                CloudColor = compound["CloudColor"] != null
                                 ? Color.FromArgb(((NbtInt) compound["CloudColor"]).Value)
                                 : Color.Black;
                SkyColor = compound["SkyColor"] != null
                               ? Color.FromArgb(((NbtInt) compound["SkyColor"]).Value)
                               : Color.Black;
                FogColor = compound["FogColor"] != null
                               ? Color.FromArgb(((NbtInt) compound["FogColor"]).Value)
                               : Color.Black;
                SkyBrightness = compound["SkyBrightness"] != null
                                    ? ((NbtByte) compound["SkyBrightness"]).Value
                                    : (byte) 0x00;
            }
        }