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


PHP FullChunk::getProvider方法代码示例

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


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

示例1: __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

示例2: __construct

 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     if ($chunk === null or $chunk->getProvider() === null) {
         throw new ChunkException("Invalid garbage Chunk given to Entity");
     }
     $this->timings = Timings::getEntityTimings($this);
     if ($this->eyeHeight === null) {
         $this->eyeHeight = $this->height / 2 + 0.1;
     }
     $this->id = Entity::$entityCount++;
     $this->justCreated = true;
     $this->namedtag = $nbt;
     $this->chunk = $chunk;
     $this->setLevel($chunk->getProvider()->getLevel());
     $this->server = $chunk->getProvider()->getLevel()->getServer();
     $this->boundingBox = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
     $this->setPositionAndRotation(new Vector3($this->namedtag["Pos"][0], $this->namedtag["Pos"][1], $this->namedtag["Pos"][2]), $this->namedtag->Rotation[0], $this->namedtag->Rotation[1], true);
     $this->setMotion(new Vector3($this->namedtag["Motion"][0], $this->namedtag["Motion"][1], $this->namedtag["Motion"][2]));
     if (!isset($this->namedtag->FallDistance)) {
         $this->namedtag->FallDistance = new Float("FallDistance", 0);
     }
     $this->fallDistance = $this->namedtag["FallDistance"];
     if (!isset($this->namedtag->Fire)) {
         $this->namedtag->Fire = new Short("Fire", 0);
     }
     $this->fireTicks = $this->namedtag["Fire"];
     if (!isset($this->namedtag->Air)) {
         $this->namedtag->Air = new Short("Air", 300);
     }
     $this->setDataProperty(self::DATA_AIR, self::DATA_TYPE_SHORT, $this->namedtag["Air"]);
     if (!isset($this->namedtag->OnGround)) {
         $this->namedtag->OnGround = new Byte("OnGround", 0);
     }
     $this->onGround = $this->namedtag["OnGround"] > 0 ? true : false;
     if (!isset($this->namedtag->Invulnerable)) {
         $this->namedtag->Invulnerable = new Byte("Invulnerable", 0);
     }
     $this->invulnerable = $this->namedtag["Invulnerable"] > 0 ? true : false;
     $this->chunk->addEntity($this);
     $this->level->addEntity($this);
     $this->initEntity();
     $this->lastUpdate = $this->server->getTick();
     $this->server->getPluginManager()->callEvent(new EntitySpawnEvent($this));
     $this->checkBlockCollisionTicks = (int) $this->server->getAdvancedProperty("main.check-block-collision", 1);
     $this->scheduleUpdate();
 }
开发者ID:RedstoneAlmeida,项目名称:Steadfast2,代码行数:46,代码来源:Entity.php

示例3: __construct

 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     assert($chunk !== null and $chunk->getProvider() !== null);
     $this->timings = Timings::getTileEntityTimings($this);
     $this->server = $chunk->getProvider()->getLevel()->getServer();
     $this->chunk = $chunk;
     $this->setLevel($chunk->getProvider()->getLevel());
     $this->namedtag = $nbt;
     $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:ClearSkyTeam,项目名称:ClearSky,代码行数:18,代码来源:Tile.php

示例4: __construct

 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     assert($chunk !== null and $chunk->getProvider() !== null);
     $this->timings = Timings::getEntityTimings($this);
     $this->isPlayer = $this instanceof Player;
     $this->temporalVector = new Vector3();
     if ($this->eyeHeight === null) {
         $this->eyeHeight = $this->height / 2 + 0.1;
     }
     $this->id = Entity::$entityCount++;
     $this->justCreated = true;
     $this->namedtag = $nbt;
     $this->chunk = $chunk;
     $this->setLevel($chunk->getProvider()->getLevel());
     $this->server = $chunk->getProvider()->getLevel()->getServer();
     $this->boundingBox = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
     $this->setPositionAndRotation($this->temporalVector->setComponents($this->namedtag["Pos"][0], $this->namedtag["Pos"][1], $this->namedtag["Pos"][2]), $this->namedtag->Rotation[0], $this->namedtag->Rotation[1]);
     $this->setMotion($this->temporalVector->setComponents($this->namedtag["Motion"][0], $this->namedtag["Motion"][1], $this->namedtag["Motion"][2]));
     assert(!is_nan($this->x) and !is_infinite($this->x) and !is_nan($this->y) and !is_infinite($this->y) and !is_nan($this->z) and !is_infinite($this->z));
     if (!isset($this->namedtag->FallDistance)) {
         $this->namedtag->FallDistance = new FloatTag("FallDistance", 0);
     }
     $this->fallDistance = $this->namedtag["FallDistance"];
     if (!isset($this->namedtag->Fire) || $this->namedtag["Fire"] > 32767) {
         $this->namedtag->Fire = new ShortTag("Fire", 0);
     }
     $this->fireTicks = $this->namedtag["Fire"];
     if (!isset($this->namedtag->Air)) {
         $this->namedtag->Air = new ShortTag("Air", 300);
     }
     $this->setDataProperty(self::DATA_AIR, self::DATA_TYPE_SHORT, $this->namedtag["Air"], false);
     if (!isset($this->namedtag->OnGround)) {
         $this->namedtag->OnGround = new ByteTag("OnGround", 0);
     }
     $this->onGround = $this->namedtag["OnGround"] > 0 ? true : false;
     if (!isset($this->namedtag->Invulnerable)) {
         $this->namedtag->Invulnerable = new ByteTag("Invulnerable", 0);
     }
     $this->invulnerable = $this->namedtag["Invulnerable"] > 0 ? true : false;
     $this->attributeMap = new AttributeMap();
     $this->chunk->addEntity($this);
     $this->level->addEntity($this);
     $this->initEntity();
     $this->lastUpdate = $this->server->getTick();
     $this->server->getPluginManager()->callEvent(new EntitySpawnEvent($this));
     $this->scheduleUpdate();
 }
开发者ID:robske110,项目名称:ClearSky,代码行数:47,代码来源:Entity.php

示例5: __construct

 /**
  * @param FullChunk $chunk
  */
 public function __construct(FullChunk $chunk)
 {
     parent::__construct($chunk->getProvider()->getLevel());
     $this->chunk = $chunk;
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:8,代码来源:ChunkEvent.php

示例6: __construct

 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     if ($chunk === null or $chunk->getProvider() === null) {
         throw new \Exception("Invalid garbage Chunk given to Entity");
     }
     if ($this->eyeHeight === null) {
         $this->eyeHeight = $this->height;
     }
     $this->id = Entity::$entityCount++;
     $this->justCreated = true;
     $this->namedtag = $nbt;
     $this->chunk = $chunk;
     $this->setLevel($chunk->getProvider()->getLevel());
     $this->server = $chunk->getProvider()->getLevel()->getServer();
     $this->boundingBox = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
     $this->setPositionAndRotation(new Vector3($this->namedtag["Pos"][0], $this->namedtag["Pos"][1], $this->namedtag["Pos"][2]), $this->namedtag->Rotation[0], $this->namedtag->Rotation[1], true);
     $this->setMotion(new Vector3($this->namedtag["Motion"][0], $this->namedtag["Motion"][1], $this->namedtag["Motion"][2]));
     if (!isset($this->namedtag->FallDistance)) {
         $this->namedtag->FallDistance = new Float("FallDistance", 0);
     }
     $this->fallDistance = $this->namedtag["FallDistance"];
     if (!isset($this->namedtag->Fire)) {
         $this->namedtag->Fire = new Short("Fire", 0);
     }
     $this->fireTicks = $this->namedtag["Fire"];
     if (!isset($this->namedtag->Air)) {
         $this->namedtag->Air = new Short("Air", 300);
     }
     $this->airTicks = $this->namedtag["Air"];
     if (!isset($this->namedtag->OnGround)) {
         $this->namedtag->OnGround = new Byte("OnGround", 1);
     }
     $this->onGround = $this->namedtag["OnGround"] > 0 ? true : false;
     if (!isset($this->namedtag->Invulnerable)) {
         $this->namedtag->Invulnerable = new Byte("Invulnerable", 0);
     }
     $this->invulnerable = $this->namedtag["Invulnerable"] > 0 ? true : false;
     $this->chunk->addEntity($this);
     $this->getLevel()->addEntity($this);
     $this->initEntity();
     $this->lastUpdate = $this->spawnTime = microtime(true);
     $this->server->getPluginManager()->callEvent(new EntitySpawnEvent($this));
     $this->scheduleUpdate();
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:44,代码来源:Entity.php

示例7: entityConstruct

 private function entityConstruct(Player $player, FullChunk $chunk, CompoundTag $nbt)
 {
     assert($chunk !== null and $chunk->getProvider() !== null);
     $this->setPrivateVariableData($player, 'timings', Timings::getEntityTimings($player));
     $this->setPrivateVariableData($player, 'isPlayer', $player instanceof Player);
     $player->temporalVector = new Vector3();
     if ($player->eyeHeight === null) {
         $player->eyeHeight = $player->height / 2 + 0.1;
     }
     $this->setPrivateVariableData($player, 'id', Entity::$entityCount++);
     $this->setPrivateVariableData($player, 'justCreated', true);
     $player->namedtag = $nbt;
     $player->chunk = $chunk;
     $player->setLevel($chunk->getProvider()->getLevel());
     $this->setPrivateVariableData($player, 'server', $chunk->getProvider()->getLevel()->getServer());
     $player->boundingBox = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
     $player->setPositionAndRotation($player->temporalVector->setComponents($player->namedtag["Pos"][0], $player->namedtag["Pos"][1], $player->namedtag["Pos"][2]), $player->namedtag->Rotation[0], $player->namedtag->Rotation[1]);
     $player->setMotion($player->temporalVector->setComponents($player->namedtag["Motion"][0], $player->namedtag["Motion"][1], $player->namedtag["Motion"][2]));
     assert(!is_nan($player->x) and !is_infinite($player->x) and !is_nan($player->y) and !is_infinite($player->y) and !is_nan($player->z) and !is_infinite($player->z));
     if (!isset($player->namedtag->FallDistance)) {
         $player->namedtag->FallDistance = new FloatTag("FallDistance", 0);
     }
     $player->fallDistance = $player->namedtag["FallDistance"];
     if (!isset($player->namedtag->Fire)) {
         $player->namedtag->Fire = new ShortTag("Fire", 0);
     }
     $player->fireTicks = $player->namedtag["Fire"];
     if (!isset($player->namedtag->Air)) {
         $player->namedtag->Air = new ShortTag("Air", 300);
     }
     $player->setDataProperty($player::DATA_AIR, $player::DATA_TYPE_SHORT, $player->namedtag["Air"]);
     if (!isset($player->namedtag->OnGround)) {
         $player->namedtag->OnGround = new ByteTag("OnGround", 0);
     }
     $player->onGround = $player->namedtag["OnGround"] > 0 ? true : false;
     if (!isset($player->namedtag->Invulnerable)) {
         $player->namedtag->Invulnerable = new ByteTag("Invulnerable", 0);
     }
     $player->invulnerable = $player->namedtag["Invulnerable"] > 0 ? true : false;
     $player->chunk->addEntity($player);
     $player->level->addEntity($player);
     $this->initialHuman($player);
     $player->lastUpdate = $this->server->getTick();
     $this->server->getPluginManager()->callEvent(new EntitySpawnEvent($player));
     $player->scheduleUpdate();
 }
开发者ID:organization,项目名称:SpawningPool,代码行数:46,代码来源:AuthenticateCallback.php


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