OK, I Really want to know what PHP: >> means! I've seen it a few times, and this was my reaction: Lol I tried to look it up but i just found random craaaaap I cri.
That means shift the binary representation right. Each time you shift the binary right you divide by two. $a >> $b That would be $a divided by 2 $b times. So $a/2^$b
Because you are switching the block coordinate to the chunk coordinate. A chunk is 16*256*16. 16 is 2^4, so we want to shift over by four places in the binary representation. So we have $chunkX = $x >> 4, and $chunkZ = $z >> 4
Because chunks are 16*16 groups of X/Z-coordinates. Therefore, we call 0 to 15 index #0, 16 to 31 index #1, -16 to -1 index #-1, vice versa. In order to convert the coordinates (0-15) to the index (0), we divide the coordinates by 16 and get the floor of the quotient (floor of x = the greatest integer smaller than x). However, using division is actually a very slow process. We can look at bit shfiting instead. For simplicity, suppose we have a 16-bit system. (That's impossible for PocketMine because PHP won't compile on 16-bit systems) As you may know, in computers, numbers are saved in binary form. 0 is presented as `0000000000000000`, and 1 is presented as `00000000000000001`. 16 is presented as `0000000000010000`, and -1 is presented as `1111111111111111`. If the bits are shifted to the right by 4, it is divided by four (16 becomes ....01 and 0 becomes ....00 and -1 becomes .....111). So it is faster for computers.