pocketmine\level\Level::blockHash PHP Method

blockHash() public static method

public static blockHash ( integer $x, integer $y, integer $z )
$x integer
$y integer
$z integer
    public static function blockHash(int $x, int $y, int $z)
    {
        return PHP_INT_SIZE === 8 ? ($x & 0xfffffff) << 35 | ($y & 0x7f) << 28 | $z & 0xfffffff : $x . ":" . $y . ":" . $z;
    }

Usage Example

Example #1
0
 protected function checkBlockCollision()
 {
     foreach ($blocksaround = $this->getBlocksAround() as $block) {
         $block->onEntityCollide($this);
         if ($this->getServer()->redstoneEnabled) {
             if ($block instanceof PressurePlate) {
                 $this->activatedPressurePlates[Level::blockHash($block->x, $block->y, $block->z)] = $block;
             }
         }
     }
     if ($this->getServer()->redstoneEnabled) {
         /** @var \pocketmine\block\PressurePlate $block * */
         foreach ($this->activatedPressurePlates as $key => $block) {
             if (!isset($blocksaround[$key])) {
                 $block->checkActivation();
             }
         }
     }
 }
All Usage Examples Of pocketmine\level\Level::blockHash
Level