當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。