本文整理汇总了PHP中pocketmine\level\format\FullChunk::setX方法的典型用法代码示例。如果您正苦于以下问题:PHP FullChunk::setX方法的具体用法?PHP FullChunk::setX怎么用?PHP FullChunk::setX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\level\format\FullChunk
的用法示例。
在下文中一共展示了FullChunk::setX方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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);
}
}
示例4: 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;
}
示例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 = ($chunkX & 4294967295.0) << 32 | $chunkZ & 4294967295.0]) and $this->chunks[$index] !== $chunk) {
$this->unloadChunk($chunkX, $chunkZ, \false);
}
$this->chunks[$index] = $chunk;
}
示例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);
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;
}
示例7: 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;
}