pocketmine\level\Level::getXZ PHP Method

getXZ() public static method

public static getXZ ( $hash, &$x, &$z )
    public static function getXZ($hash, &$x, &$z)
    {
        if (PHP_INT_SIZE === 8) {
            $x = $hash >> 32 << 32 >> 32;
            $z = ($hash & 0xffffffff) << 32 >> 32;
        } else {
            $hash = explode(":", $hash);
            $x = (int) $hash[0];
            $z = (int) $hash[1];
        }
    }

Usage Example

 public function onCompletion(Server $server)
 {
     $chunks = $this->getResult();
     $plugin = $server->getPluginManager()->getPlugin("MineReset");
     if ($plugin instanceof MineReset and $plugin->isEnabled()) {
         $level = $server->getLevel($this->levelId);
         if ($level != null) {
             foreach ($chunks as $hash => $chunk) {
                 Level::getXZ($hash, $x, $z);
                 $level->setChunk($x, $z, $chunk);
             }
         }
         $plugin->getRegionBlocker()->freeZone($this->regionId, $this->levelId);
     }
 }
All Usage Examples Of pocketmine\level\Level::getXZ
Level