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


PHP Entity::initEntity方法代码示例

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


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

示例1: initEntity

 protected function initEntity()
 {
     parent::initEntity();
     $this->setMaxHealth(5);
     $this->setHealth($this->namedtag["Health"]);
     if (isset($this->namedtag->Age)) {
         $this->age = $this->namedtag["Age"];
     }
     if (isset($this->namedtag->PickupDelay)) {
         $this->pickupDelay = $this->namedtag["PickupDelay"];
     }
     if (isset($this->namedtag->Owner)) {
         $this->owner = $this->namedtag["Owner"];
     }
     if (isset($this->namedtag->Thrower)) {
         $this->thrower = $this->namedtag["Thrower"];
     }
     if (!isset($this->namedtag->Item)) {
         $this->close();
         return;
     }
     assert($this->namedtag->Item instanceof CompoundTag);
     $this->item = NBT::getItemHelper($this->namedtag->Item);
     $this->server->getPluginManager()->callEvent(new ItemSpawnEvent($this));
 }
开发者ID:xxFlare,项目名称:PocketMine-MP,代码行数:25,代码来源:Item.php

示例2: initEntity

 protected function initEntity()
 {
     parent::initEntity();
     if (isset($this->namedtag->remove)) {
         //flag check
         $this->kill();
     }
 }
开发者ID:MrDoni98,项目名称:PocketMine-MP-Plugins,代码行数:8,代码来源:Chair.php

示例3: initEntity

 public function initEntity()
 {
     if (isset($this->namedtag->Movement)) {
         $this->setMovement($this->namedtag["Movement"]);
     }
     $this->dataProperties[self::DATA_NO_AI] = [self::DATA_TYPE_BYTE, 1];
     Entity::initEntity();
 }
开发者ID:rilex04,项目名称:EntityManager,代码行数:8,代码来源:BaseEntity.php

示例4: initEntity

 public function initEntity()
 {
     parent::initEntity();
     if (isset($this->namedtag->Experience)) {
         $this->experience = $this->namedtag["Experience"];
     } else {
         $this->close();
     }
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:9,代码来源:ExperienceOrb.php

示例5: initEntity

 protected function initEntity()
 {
     parent::initEntity();
     $this->setMaxHealth(1);
     $this->setHealth(1);
     if (isset($this->namedtag->Age)) {
         $this->age = $this->namedtag["Age"];
     }
 }
开发者ID:TylerGames,项目名称:PocketMine-MP,代码行数:9,代码来源:Projectile.php

示例6: initEntity

 protected function initEntity()
 {
     parent::initEntity();
     if (isset($this->namedtag->Fuse)) {
         $this->fuse = $this->namedtag["Fuse"];
     } else {
         $this->fuse = 80;
     }
 }
开发者ID:kiyoshi-kurosaki,项目名称:ClearSky,代码行数:9,代码来源:PrimedTNT.php

示例7: initEntity

 protected function initEntity()
 {
     parent::initEntity();
     if (isset($this->namedtag->HealF)) {
         $this->namedtag->Health = new ShortTag("Health", (int) $this->namedtag["HealF"]);
         unset($this->namedtag->HealF);
     } elseif (!isset($this->namedtag->Health) or !$this->namedtag->Health instanceof ShortTag) {
         $this->namedtag->Health = new ShortTag("Health", $this->getMaxHealth());
     }
     $this->setHealth($this->namedtag["Health"]);
 }
开发者ID:ianju,项目名称:PocketMine-MP,代码行数:11,代码来源:Living.php

示例8: initEntity

 protected function initEntity()
 {
     parent::initEntity();
     if (isset($this->namedtag->HealF)) {
         $this->namedtag->Health = new ShortTag("Health", (int) $this->namedtag["HealF"]);
         unset($this->namedtag->HealF);
     } elseif (!isset($this->namedtag->Health) or !$this->namedtag->Health instanceof ShortTag) {
         $this->namedtag->Health = new ShortTag("Health", $this->getMaxHealth());
     }
     if (!isset($this->namedtag->MaxHealth) or !$this->namedtag->MaxHealth instanceof ShortTag) {
         $this->namedtag->MaxHealth = new ShortTag("MaxHealth", $this->getMaxHealth());
     }
     $this->setMaxHealth($this->namedtag["MaxHealth"]);
     $this->setHealth($this->getAttributeMap()->getAttribute(Attribute::HEALTH)->setMaxValue($this->getMaxHealth())->setValue($this->namedtag["Health"]));
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:15,代码来源:Living.php

示例9: initEntity

 protected function initEntity()
 {
     parent::initEntity();
     if (isset($this->namedtag->TileID)) {
         $this->blockId = $this->namedtag["TileID"];
     } elseif (isset($this->namedtag->Tile)) {
         $this->blockId = $this->namedtag["Tile"];
         $this->namedtag["TileID"] = new Int("TileID", $this->blockId);
     }
     if (isset($this->namedtag->Data)) {
         $this->damage = $this->namedtag["Data"];
     }
     if ($this->blockId === 0) {
         $this->close();
         return;
     }
     $this->setDataProperty(self::DATA_BLOCK_INFO, self::DATA_TYPE_INT, $this->getBlock() | $this->getDamage() << 8);
 }
开发者ID:sfpboomz,项目名称:ImagicalMine,代码行数:18,代码来源:FallingSand.php

示例10: initEntity

 protected function initEntity()
 {
     parent::initEntity();
     $this->setMaxHealth(5);
     $this->setHealth($this->namedtag["Health"]);
     if (isset($this->namedtag->Age)) {
         $this->age = $this->namedtag["Age"];
     }
     if (isset($this->namedtag->PickupDelay)) {
         $this->pickupDelay = $this->namedtag["PickupDelay"];
     }
     if (isset($this->namedtag->Owner)) {
         $this->owner = $this->namedtag["Owner"];
     }
     if (isset($this->namedtag->Thrower)) {
         $this->thrower = $this->namedtag["Thrower"];
     }
     $this->item = ItemItem::get($this->namedtag->Item["id"], $this->namedtag->Item["Damage"], $this->namedtag->Item["Count"]);
     $this->server->getPluginManager()->callEvent(new ItemSpawnEvent($this));
 }
开发者ID:Cybertechpp,项目名称:Steadfast2,代码行数:20,代码来源:Item.php

示例11: initEntity

 public function initEntity()
 {
     $this->setMaxHealth(1);
     parent::initEntity();
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:5,代码来源:SmallFireball.php

示例12: initEntity

 public function initEntity()
 {
     parent::initEntity();
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:4,代码来源:LeashKnot.php

示例13: initEntity

 public function initEntity()
 {
     if (isset($this->namedtag->Movement)) {
         $this->setMovement($this->namedtag["Movement"]);
     }
     $this->dataProperties = [self::DATA_FLAGS => [self::DATA_TYPE_BYTE, 0], self::DATA_AIR => [self::DATA_TYPE_SHORT, 300], self::DATA_NAMETAG => [self::DATA_TYPE_STRING, ""], self::DATA_SHOW_NAMETAG => [self::DATA_TYPE_BYTE, 1], self::DATA_SILENT => [self::DATA_TYPE_BYTE, 0], self::DATA_NO_AI => [self::DATA_TYPE_BYTE, 0]];
     Entity::initEntity();
 }
开发者ID:organization,项目名称:DummyPlayer,代码行数:8,代码来源:BaseEntity.php


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