コード例 #1
0
        /// <summary>
        /// Sets the light value at the coordinate. If enumskyblock is set to sky it sets it in the skylightmap and if its a
        /// block then into the blocklightmap. Args enumSkyBlock, x, y, z, lightValue
        /// </summary>
        public virtual void SetLightValue(SkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5)
        {
            ExtendedBlockStorage extendedblockstorage = storageArrays[par3 >> 4];

            if (extendedblockstorage == null)
            {
                extendedblockstorage = storageArrays[par3 >> 4] = new ExtendedBlockStorage((par3 >> 4) << 4);
                GenerateSkylightMap();
            }

            IsModified = true;

            if (par1EnumSkyBlock == SkyBlock.Sky)
            {
                if (!WorldObj.WorldProvider.HasNoSky)
                {
                    extendedblockstorage.SetExtSkylightValue(par2, par3 & 0xf, par4, par5);
                }
            }
            else if (par1EnumSkyBlock == SkyBlock.Block)
            {
                extendedblockstorage.SetExtBlocklightValue(par2, par3 & 0xf, par4, par5);
            }
            else
            {
                return;
            }
        }