当前位置: 首页>>代码示例>>PHP>>正文


PHP FullChunk::setProvider方法代码示例

本文整理汇总了PHP中pocketmine\level\format\FullChunk::setProvider方法的典型用法代码示例。如果您正苦于以下问题:PHP FullChunk::setProvider方法的具体用法?PHP FullChunk::setProvider怎么用?PHP FullChunk::setProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\level\format\FullChunk的用法示例。


在下文中一共展示了FullChunk::setProvider方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: generateChunkCallback

 public function generateChunkCallback($x, $z, FullChunk $chunk)
 {
     $oldChunk = $this->getChunk($x, $z, false);
     unset($this->chunkGenerationQueue[PHP_INT_SIZE === 8 ? ($x & 4294967295.0) << 32 | $z & 4294967295.0 : $x . ":" . $z]);
     $chunk->setProvider($this->provider);
     $this->setChunk($x, $z, $chunk);
     $chunk = $this->getChunk($x, $z, false);
     if ($chunk !== null and ($oldChunk === null or $oldChunk->isPopulated() === false) and $chunk->isPopulated()) {
         $this->server->getPluginManager()->callEvent(new ChunkPopulateEvent($chunk));
     }
 }
开发者ID:RedstoneAlmeida,项目名称:Steadfast2,代码行数:11,代码来源:Level.php

示例2: generateChunkCallback

 public function generateChunkCallback($x, $z, FullChunk $chunk)
 {
     Timings::$generationCallbackTimer->startTiming();
     if (isset($this->chunkPopulationQueue[$index = Level::chunkHash($x, $z)])) {
         $oldChunk = $this->getChunk($x, $z, false);
         for ($xx = -1; $xx <= 1; ++$xx) {
             for ($zz = -1; $zz <= 1; ++$zz) {
                 unset($this->chunkPopulationLock[Level::chunkHash($x + $xx, $z + $zz)]);
             }
         }
         unset($this->chunkPopulationQueue[$index]);
         $chunk->setProvider($this->provider);
         $this->setChunk($x, $z, $chunk, false);
         $chunk = $this->getChunk($x, $z, false);
         if ($chunk !== null and ($oldChunk === null or $oldChunk->isPopulated() === false) and $chunk->isPopulated() and $chunk->getProvider() !== null) {
             $this->server->getPluginManager()->callEvent(new ChunkPopulateEvent($chunk));
             foreach ($this->getChunkLoaders($x, $z) as $loader) {
                 $loader->onChunkPopulated($chunk);
             }
         }
     } elseif (isset($this->chunkGenerationQueue[$index]) or isset($this->chunkPopulationLock[$index])) {
         unset($this->chunkGenerationQueue[$index]);
         unset($this->chunkPopulationLock[$index]);
         $chunk->setProvider($this->provider);
         $this->setChunk($x, $z, $chunk, false);
     } else {
         $chunk->setProvider($this->provider);
         $this->setChunk($x, $z, $chunk, false);
     }
     Timings::$generationCallbackTimer->stopTiming();
 }
开发者ID:robozeri,项目名称:Yuriko-MP,代码行数:31,代码来源:Level.php

示例3: setChunk

 public function setChunk($chunkX, $chunkZ, FullChunk $chunk)
 {
     if (!$chunk instanceof Chunk) {
         throw new ChunkException("Invalid Chunk class");
     }
     $chunk->setProvider($this);
     self::getRegionIndex($chunkX, $chunkZ, $regionX, $regionZ);
     $this->loadRegion($regionX, $regionZ);
     $chunk->setX($chunkX);
     $chunk->setZ($chunkZ);
     if (isset($this->chunks[$index = Level::chunkHash($chunkX, $chunkZ)]) and $this->chunks[$index] !== $chunk) {
         $this->unloadChunk($chunkX, $chunkZ, false);
     }
     $this->chunks[$index] = $chunk;
 }
开发者ID:Creeperface01,项目名称:ImagicalMine,代码行数:15,代码来源:McRegion.php

示例4: setChunk

 public function setChunk($chunkX, $chunkZ, FullChunk $chunk)
 {
     if (!$chunk instanceof Chunk) {
         throw new \Exception("Invalid Chunk class");
     }
     $chunk->setProvider($this);
     if ($chunk->isPopulated() === false) {
         $this->unloadChunk($chunkX, $chunkZ, false);
         $regionX = $regionZ = null;
         self::getRegionIndex($chunkX, $chunkZ, $regionX, $regionZ);
         $this->loadRegion($regionX, $regionZ);
         $region = $this->getRegion($regionX, $regionZ);
         $region->removeChunk($chunkX - $region->getX() * 32, $chunkZ - $region->getZ() * 32);
         $this->loadChunk($chunkX, $chunkZ);
     } else {
         $chunk->setX($chunkX);
         $chunk->setZ($chunkZ);
         $this->chunks[Level::chunkHash($chunkX, $chunkZ)] = $chunk;
         //$this->saveChunk($chunkX, $chunkZ);
     }
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:21,代码来源:McRegion.php

示例5: setChunk

 public function setChunk($chunkX, $chunkZ, FullChunk $chunk)
 {
     if (!$chunk instanceof Chunk) {
         throw new ChunkException("Invalid Chunk class");
     }
     $chunk->setProvider($this);
     $chunk->setX($chunkX);
     $chunk->setZ($chunkZ);
     if (isset($this->chunks[$index = \PHP_INT_SIZE === 8 ? ($chunkX & 0xffffffff) << 32 | $chunkZ & 0xffffffff : $chunkX . ":" . $chunkZ]) and $this->chunks[$index] !== $chunk) {
         $this->unloadChunk($chunkX, $chunkZ, \false);
     }
     $this->chunks[$index] = $chunk;
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:13,代码来源:LevelDB.php

示例6: setChunk

 public function setChunk($chunkX, $chunkZ, FullChunk $chunk)
 {
     if (!$chunk instanceof Chunk) {
         throw new ChunkException("Invalid Chunk class");
     }
     $chunk->setProvider($this);
     self::getRegionIndex($chunkX, $chunkZ, $regionX, $regionZ);
     $this->loadRegion($regionX, $regionZ);
     $chunk->setX($chunkX);
     $chunk->setZ($chunkZ);
     $this->chunks[\PHP_INT_SIZE === 8 ? ($chunkX & 0xffffffff) << 32 | $chunkZ & 0xffffffff : $chunkX . ":" . $chunkZ] = $chunk;
 }
开发者ID:Edwardthedog2,项目名称:Steadfast2,代码行数:12,代码来源:Anvil.php

示例7: setChunk

 public function setChunk($chunkX, $chunkZ, FullChunk $chunk)
 {
     if (!$chunk instanceof Chunk) {
         throw new ChunkException("Invalid Chunk class");
     }
     $chunk->setProvider($this);
     $chunk->setX($chunkX);
     $chunk->setZ($chunkZ);
     if (isset($this->chunks[$index = ($chunkX & 4294967295.0) << 32 | $chunkZ & 4294967295.0]) and $this->chunks[$index] !== $chunk) {
         $this->unloadChunk($chunkX, $chunkZ, \false);
     }
     $this->chunks[$index] = $chunk;
 }
开发者ID:ken77731,项目名称:PocketMine-0.13.0,代码行数:13,代码来源:LevelDB__64bit.php

示例8: setChunk

 public function setChunk($chunkX, $chunkZ, FullChunk $chunk)
 {
     if (!$chunk instanceof Chunk) {
         throw new ChunkException("Invalid Chunk class");
     }
     $chunk->setProvider($this);
     self::getRegionIndex($chunkX, $chunkZ, $regionX, $regionZ);
     $this->loadRegion($regionX, $regionZ);
     $chunk->setX($chunkX);
     $chunk->setZ($chunkZ);
     if (isset($this->chunks[$index = PHP_INT_SIZE === 8 ? ($chunkX & 4294967295.0) << 32 | $chunkZ & 4294967295.0 : $chunkX . ":" . $chunkZ]) and $this->chunks[$index] !== $chunk) {
         $this->unloadChunk($chunkX, $chunkZ, false);
     }
     $this->chunks[$index] = $chunk;
 }
开发者ID:Hydreon,项目名称:PMSoft238,代码行数:15,代码来源:McRegion.php

示例9: generateChunkCallback

 public function generateChunkCallback($x, $z, FullChunk $chunk)
 {
     $oldChunk = $this->getChunk($x, $z, false);
     unset($this->chunkGenerationQueue[Level::chunkHash($x, $z)]);
     $chunk->setProvider($this->provider);
     $this->setChunk($x, $z, $chunk);
     $chunk = $this->getChunk($x, $z, false);
     if ($chunk !== null and ($oldChunk === null or $oldChunk->isPopulated() === false) and $chunk->isPopulated()) {
         $this->server->getPluginManager()->callEvent(new ChunkPopulateEvent($chunk));
     }
 }
开发者ID:hlogeon,项目名称:PocketMineJs-MP,代码行数:11,代码来源:Level.php

示例10: setChunk

 public function setChunk($chunkX, $chunkZ, FullChunk $chunk)
 {
     if (!$chunk instanceof Chunk) {
         throw new ChunkException("Invalid Chunk class");
     }
     $chunk->setProvider($this);
     self::getRegionIndex($chunkX, $chunkZ, $regionX, $regionZ);
     $this->loadRegion($regionX, $regionZ);
     $chunk->setX($chunkX);
     $chunk->setZ($chunkZ);
     $this->chunks[($chunkX & 4294967295.0) << 32 | $chunkZ & 4294967295.0] = $chunk;
 }
开发者ID:ken77731,项目名称:PocketMine-0.13.0,代码行数:12,代码来源:Anvil__64bit.php


注:本文中的pocketmine\level\format\FullChunk::setProvider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。