Example #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;
            }
        }
Example #2
0
        /// <summary>
        /// Gets the amount of light saved in this block (doesn't adjust for daylight)
        /// </summary>
        public virtual int GetSavedLightValue(SkyBlock par1EnumSkyBlock, int par2, int par3, int par4)
        {
            ExtendedBlockStorage extendedblockstorage = storageArrays[par3 >> 4];

            if (extendedblockstorage == null)
            {
                return(par1EnumSkyBlock.DefaultLightValue);
            }

            if (par1EnumSkyBlock == SkyBlock.Sky)
            {
                return(extendedblockstorage.GetExtSkylightValue(par2, par3 & 0xf, par4));
            }

            if (par1EnumSkyBlock == SkyBlock.Block)
            {
                return(extendedblockstorage.GetExtBlocklightValue(par2, par3 & 0xf, par4));
            }
            else
            {
                return(par1EnumSkyBlock.DefaultLightValue);
            }
        }
Example #3
0
 /// <summary>
 /// Gets the amount of light saved in this block (doesn't adjust for daylight)
 /// </summary>
 public override int GetSavedLightValue(SkyBlock par1EnumSkyBlock, int par2, int par3, int i)
 {
     return(0);
 }
Example #4
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 override void SetLightValue(SkyBlock enumskyblock, int i, int j, int k, int l)
 {
 }