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


PHP Animal::initEntity方法代码示例

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


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

示例1: initEntity

 public function initEntity()
 {
     //^ changed from protected->public for 1.5
     parent::initEntity();
     if (isset($this->namedtag->Owner)) {
         $this->owner = $this->namedtag["Owner"];
     } else {
         $this->owner = "";
     }
     $x = floor($this->namedtag->Pos[0]);
     $y = floor($this->namedtag->Pos[1]);
     $z = floor($this->namedtag->Pos[2]);
     $mgr = $this->server->getPluginManager()->getPlugin("Mobsters");
     if ($mgr) {
         list($owner, $id) = $mgr->getSpawner($x, $y, $z);
         if ($owner && $id == self::NETWORK_ID) {
             $this->owner = $owner;
             $this->namedtag->Owner = new String("Owner", $this->owner);
         }
     }
     if ($this->owner) {
         echo "Perrito de " . $this->owner . "\n";
     }
     //##DEBUG
 }
开发者ID:johnfontaine,项目名称:bad-plugins,代码行数:25,代码来源:Wolf.php

示例2: initEntity

 public function initEntity()
 {
     $this->setMaxHealth(6);
     parent::initEntity();
     /*for($i = 1; $i < 40; $i++){
     			$this->setDataProperty($i, self::DATA_TYPE_BYTE, 1);
     		}*/
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:8,代码来源:Bat.php

示例3: initEntity

 public function initEntity()
 {
     $this->setMaxHealth(3);
     parent::initEntity();
     if (!isset($this->namedtag->Type)) {
         $this->setType(mt_rand(0, 5));
     }
 }
开发者ID:orlando092,项目名称:ImagicalMine,代码行数:8,代码来源:Rabbit.php

示例4: initEntity

 public function initEntity()
 {
     $this->setMaxHealth(8);
     parent::initEntity();
     if (!isset($this->namedtag->Color) || $this->getVariant() > 15) {
         $this->setVariant(mt_rand(0, 15));
     }
     $this->setDataProperty(16, self::DATA_TYPE_BYTE, $this->getVariant());
 }
开发者ID:kakichi,项目名称:ClearSky,代码行数:9,代码来源:Sheep.php

示例5: initEntity

 public function initEntity()
 {
     $this->setMaxHealth(20);
     parent::initEntity();
     if (!isset($this->namedtag->Profession) || $this->getVariant() > 4) {
         $this->setVariant(mt_rand(0, 4));
     }
     $this->setDataProperty(16, self::DATA_TYPE_BYTE, $this->getVariant());
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:9,代码来源:Villager.php

示例6: initEntity

 public function initEntity()
 {
     $this->setMaxHealth(10);
     parent::initEntity();
     //0 burning
     //1 air time
     //5 invis
     //14 age (0=baby 130000 = parent)
     //15 no movement
     //16 sheep color
     //18 type/variant
     //19 creeper charged
     //21 love
     if (!isset($this->namedtag->Type) || $this->getVariant() > 3) {
         $this->setVariant(self::TYPE_NORMAL);
     }
     $this->setDataProperty(16, self::DATA_TYPE_BYTE, $this->getVariant());
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:18,代码来源:Ozelot.php

示例7: initEntity

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

示例8: initEntity

 public function initEntity()
 {
     $this->setMaxHealth(8);
     //Untamed
     parent::initEntity();
 }
开发者ID:orlando092,项目名称:ImagicalMine,代码行数:6,代码来源:Wolf.php

示例9: initEntity

 public function initEntity()
 {
     parent::initEntity();
     $this->setMaxHealth(2);
     $this->setHealth(2);
 }
开发者ID:yungtechboy1,项目名称:Genisys,代码行数:6,代码来源:Lightning.php


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