Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bugs with getBlockLightAt and setBlockLightAt

Comments in 'Plugin Development' started by WinniePooh, Aug 23, 2014.

  1. WinniePooh
    Offline

    WinniePooh New Member

    Joined:
    Jun 12, 2014
    Posts:
    16
    Minecraft User:
    WinniePooh
    getBlockLightAt always returns Level 15 (when night, when day and etc).
    setBlockLightAt doesn't work.
    I have problems with these functions in all cases (in minecraft pe and in BigBrother).
    In details I wanted set Block light when a player touches on it.

    So, I apologize for my bad language.

    PHP:
    /**
         * Gets the raw block light level
         *
         * @param int $x
         * @param int $y
         * @param int $z
         *
         * @return int 0-15
         */
        
    public function getBlockLightAt($x$y$z){
            return 
    $this->getChunkAt($x >> 4$z >> 4true)->getBlockLight($x 0x0f$y 0x7f$z 0x0f);
        }
    PHP:
    /**
         * Sets the raw block light level.
         *
         * @param int $x
         * @param int $y
         * @param int $z
         * @param int $level 0-15
         */
        
    public function setBlockLightAt($x$y$z$level){
            
    $this->getChunkAt($x >> 4$z >> 4true)->setBlockLight($x 0x0f$y 0x7f$z 0x0f$level 0x0f);
        }
  2. Kagehis4
    Offline

    Kagehis4 New Member

    Joined:
    Aug 20, 2014
    Posts:
    44
    Minecraft User:
    Kagehis4
    Have you tried getBlockSkyLightAt
  3. WinniePooh
    Offline

    WinniePooh New Member

    Joined:
    Jun 12, 2014
    Posts:
    16
    Minecraft User:
    WinniePooh
    This function always returns 15 too.
  4. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Last edited: Aug 11, 2015

Share This Page

Advertisement