當前位置: 首頁>>代碼示例>>PHP>>正文


PHP format\FullChunk類代碼示例

本文整理匯總了PHP中pocketmine\level\format\FullChunk的典型用法代碼示例。如果您正苦於以下問題:PHP FullChunk類的具體用法?PHP FullChunk怎麽用?PHP FullChunk使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了FullChunk類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct(Level $level, FullChunk $chunk)
 {
     $this->state = true;
     $this->levelId = $level->getId();
     $this->chunk = $chunk->toFastBinary();
     $this->chunkClass = get_class($chunk);
 }
開發者ID:wsj7178,項目名稱:PocketMine-MP,代碼行數:7,代碼來源:GenerationTask.php

示例2: __construct

 public function __construct(Level $level, FullChunk $chunk)
 {
     $this->state = true;
     $this->levelId = $level->getId();
     $this->chunk = $chunk->toFastBinary();
     $this->chunkClass = get_class($chunk);
     $this->chunk00 = $level->getChunk($chunk->getX() - 1, $chunk->getZ() - 1, true)->toFastBinary();
     $this->chunk01 = $level->getChunk($chunk->getX() - 1, $chunk->getZ(), true)->toFastBinary();
     $this->chunk02 = $level->getChunk($chunk->getX() - 1, $chunk->getZ() + 1, true)->toFastBinary();
     $this->chunk10 = $level->getChunk($chunk->getX(), $chunk->getZ() - 1, true)->toFastBinary();
     $this->chunk12 = $level->getChunk($chunk->getX(), $chunk->getZ() + 1, true)->toFastBinary();
     $this->chunk20 = $level->getChunk($chunk->getX() + 1, $chunk->getZ() - 1, true)->toFastBinary();
     $this->chunk21 = $level->getChunk($chunk->getX() + 1, $chunk->getZ(), true)->toFastBinary();
     $this->chunk22 = $level->getChunk($chunk->getX() + 1, $chunk->getZ() + 1, true)->toFastBinary();
 }
開發者ID:TylerGames,項目名稱:PocketMine-MP,代碼行數:15,代碼來源:PopulationTask.php

示例3: __construct

 public function __construct(Level $level, FullChunk $chunk)
 {
     $this->state = \true;
     $this->levelId = $level->getId();
     $this->chunk = $chunk->toFastBinary();
     $this->chunkClass = \get_class($chunk);
     for ($i = 0; $i < 9; ++$i) {
         if ($i === 4) {
             continue;
         }
         $xx = -1 + $i % 3;
         $zz = -1 + (int) ($i / 3);
         $ck = $level->getChunk($chunk->getX() + $xx, $chunk->getZ() + $zz, \false);
         $this->{"chunk{$i}"} = $ck !== \null ? $ck->toFastBinary() : \null;
     }
 }
開發者ID:xpyctum,項目名稱:PocketMinePlusPlus,代碼行數:16,代碼來源:PopulationTask.php

示例4: __construct

 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     if ($chunk === null or $chunk->getProvider() === null) {
         throw new \Exception("Invalid garbage Chunk given to Tile");
     }
     $this->server = $chunk->getProvider()->getLevel()->getServer();
     $this->chunk = $chunk;
     $this->setLevel($chunk->getProvider()->getLevel());
     $this->namedtag = $nbt;
     $this->closed = false;
     $this->name = "";
     $this->lastUpdate = microtime(true);
     $this->id = Tile::$tileCount++;
     $this->x = (int) $this->namedtag["x"];
     $this->y = (int) $this->namedtag["y"];
     $this->z = (int) $this->namedtag["z"];
     $this->chunk->addTile($this);
     $this->getLevel()->addTile($this);
     $this->tickTimer = Timings::getTileEntityTimings($this);
 }
開發者ID:boybook,項目名稱:PocketMine-MP,代碼行數:20,代碼來源:Tile.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: receiveChunk

 protected function receiveChunk($levelID, FullChunk $chunk)
 {
     if ($this->needsChunk[$levelID] !== null) {
         if ($this->needsChunk[$levelID][0] === $chunk->getX() and $this->needsChunk[$levelID][1] === $chunk->getZ()) {
             $this->needsChunk[$levelID] = $chunk;
         }
     }
     //TODO: set new received chunks
 }
開發者ID:boybook,項目名稱:PocketMine-MP,代碼行數:9,代碼來源:GenerationManager.php

示例7: writeChunk

 public function writeChunk(FullChunk $chunk)
 {
     $this->saveChunk($chunk->getX() - $this->getX() * 32, $chunk->getZ() - $this->getZ() * 32, $chunk->toBinary());
 }
開發者ID:rryy,項目名稱:PocketMine-MP,代碼行數:4,代碼來源:RegionLoader.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[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

示例10: writeChunk

 public function writeChunk(FullChunk $chunk)
 {
     $this->lastUsed = \time();
     $chunkData = $chunk->toBinary();
     if ($chunkData !== \false) {
         $this->saveChunk($chunk->getX() - $this->getX() * 32, $chunk->getZ() - $this->getZ() * 32, $chunkData);
     }
 }
開發者ID:xpyctum,項目名稱:PocketMinePlusPlus,代碼行數:8,代碼來源:RegionLoader__64bit.php

示例11: setChunk

 /**
  * @param int       $chunkX
  * @param int       $chunkZ
  * @param FullChunk $chunk
  */
 public function setChunk($chunkX, $chunkZ, FullChunk $chunk)
 {
     $this->chunks[$index = PHP_INT_SIZE === 8 ? ($chunkX & 0xffffffff) << 32 | $chunkZ & 0xffffffff : $chunkX . ":" . $chunkZ] = $chunk;
     $this->changes[$index] = $chunk;
     if ($chunk->isPopulated()) {
         //TODO: Queue to be sent
     }
 }
開發者ID:ZenaGamingsky,項目名稱:Steadfast2,代碼行數:13,代碼來源:GenerationChunkManager.php

示例12: 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

示例13: 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

示例14: 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

示例15: 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


注:本文中的pocketmine\level\format\FullChunk類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。