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


PHP tile\Spawnable类代码示例

本文整理汇总了PHP中pocketmine\tile\Spawnable的典型用法代码示例。如果您正苦于以下问题:PHP Spawnable类的具体用法?PHP Spawnable怎么用?PHP Spawnable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: __construct

 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     if (!isset($nbt->note)) {
         $nbt->note = new ByteTag("note", 0);
     }
     parent::__construct($chunk, $nbt);
 }
开发者ID:beito123,项目名称:PocketMine-MP-Plugins,代码行数:7,代码来源:Note.php

示例2: __construct

 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     parent::__construct($chunk, $nbt);
     if (!isset($nbt->EntityId)) {
         $nbt->EntityId = new IntTag("EntityId", 0);
     }
     if (!isset($nbt->SpawnCount)) {
         $nbt->SpawnCount = new IntTag("SpawnCount", 4);
     }
     if (!isset($nbt->SpawnRange)) {
         $nbt->SpawnRange = new IntTag("SpawnRange", 4);
     }
     if (!isset($nbt->MinSpawnDelay)) {
         $nbt->MinSpawnDelay = new IntTag("MinSpawnDelay", 200);
     }
     if (!isset($nbt->MaxSpawnDelay)) {
         $nbt->MaxSpawnDelay = new IntTag("MaxSpawnDelay", 799);
     }
     if (!isset($nbt->Delay)) {
         $nbt->Delay = new IntTag("Delay", mt_rand($nbt->MinSpawnDelay->getValue(), $nbt->MaxSpawnDelay->getValue()));
     }
     if ($this->getEntityId() > 0) {
         $this->scheduleUpdate();
     }
 }
开发者ID:iTXTech,项目名称:Genisys,代码行数:25,代码来源:MobSpawner.php

示例3: close

 public function close()
 {
     if ($this->closed === false) {
         foreach ($this->getInventory()->getViewers() as $player) {
             $player->removeWindow($this->getInventory());
         }
         parent::close();
     }
 }
开发者ID:iTXTech,项目名称:Genisys,代码行数:9,代码来源:BrewingStand.php

示例4: __construct

 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     if (!isset($nbt->Item)) {
         $nbt->item = new ShortTag("item", 0);
     }
     if (!isset($nbt->Data)) {
         $nbt->mData = new IntTag("mData", 0);
     }
     parent::__construct($chunk, $nbt);
 }
开发者ID:xxFlare,项目名称:PocketMine-MP,代码行数:10,代码来源:FlowerPot.php

示例5: __construct

 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     if (!isset($nbt->item)) {
         $nbt->item = new Short("item", 0);
     }
     if (!isset($nbt->data)) {
         $nbt->data = new Int("data", 0);
     }
     parent::__construct($chunk, $nbt);
 }
开发者ID:ecoron,项目名称:MinionsLandPE,代码行数:10,代码来源:FlowerPot.php

示例6: __construct

 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     if (!isset($nbt->SkullType)) {
         $nbt->SkullType = new ByteTag("SkullType", 0);
     }
     if (!isset($nbt->Rot)) {
         $nbt->Rot = new ByteTag("Rot", 0);
     }
     parent::__construct($chunk, $nbt);
 }
开发者ID:beito123,项目名称:PocketMine-MP-Plugins,代码行数:10,代码来源:Skull.php

示例7: __construct

 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     if (!isset($nbt->EntityId)) {
         $nbt->EntityId = new IntTag("EntityId", 0);
     }
     parent::__construct($chunk, $nbt);
     $this->lastUpdate = $this->getLevel()->getServer()->getTick();
     if ($this->getEntityId() > 0) {
         $this->scheduleUpdate();
     }
 }
开发者ID:xpyctum,项目名称:Genisys,代码行数:11,代码来源:MobSpawner.php

示例8: close

 public function close()
 {
     if ($this->closed === false) {
         foreach ($this->getInventory()->getViewers() as $player) {
             $this->getInventory()->close($player);
         }
         foreach ($this->getRealInventory()->getViewers() as $player) {
             $this->getRealInventory()->close($player);
         }
         parent::close();
     }
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:12,代码来源:Chest.php

示例9: __construct

 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     if (!isset($nbt->PotionId)) {
         $nbt->PotionId = new ShortTag("PotionId", 0xffff);
     }
     if (!isset($nbt->SplashPotion)) {
         $nbt->SplashPotion = new ByteTag("SplashPotion", 0);
     }
     if (!isset($nbt->Items) or !$nbt->Items instanceof ListTag) {
         $nbt->Items = new ListTag("Items", []);
     }
     parent::__construct($chunk, $nbt);
 }
开发者ID:iTXTech,项目名称:Genisys,代码行数:13,代码来源:Cauldron.php

示例10: close

 public function close()
 {
     if ($this->closed === false) {
         foreach ($this->getInventory()->getViewers() as $player) {
             $player->removeWindow($this->getInventory());
         }
         foreach ($this->getTile()->getInventory() as $chest) {
             $chest->removeWindow($this->getRealInventory());
             //Testing
         }
         parent::close();
     }
 }
开发者ID:JimmyCZChlumec,项目名称:PocketMine-0.13.0,代码行数:13,代码来源:Chest.php

示例11: __construct

 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     if (!isset($nbt->Item)) {
         $nbt->Item = NBT::putItemHelper(Item::get(Item::AIR));
         $nbt->Item->setName("Item");
     }
     if (!isset($nbt->ItemRotation)) {
         $nbt->ItemRotation = new ByteTag("ItemRotation", 0);
     }
     if (!isset($nbt->ItemDropChance)) {
         $nbt->ItemDropChance = new FloatTag("ItemDropChance", 1.0);
     }
     parent::__construct($chunk, $nbt);
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:14,代码来源:ItemFrame.php

示例12: __construct

 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     $nbt["id"] = Tile::SIGN;
     if (!isset($nbt->Text1)) {
         $nbt->Text1 = new String("Text1", "");
     }
     if (!isset($nbt->Text2)) {
         $nbt->Text2 = new String("Text2", "");
     }
     if (!isset($nbt->Text3)) {
         $nbt->Text3 = new String("Text3", "");
     }
     if (!isset($nbt->Text4)) {
         $nbt->Text4 = new String("Text4", "");
     }
     parent::__construct($chunk, $nbt);
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:17,代码来源:Sign.php

示例13: __construct

 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     parent::__construct($chunk, $nbt);
     $this->inventory = new EnchantInventory($this);
 }
开发者ID:xpyctum,项目名称:Genisys,代码行数:5,代码来源:EnchantTable.php

示例14: __construct

 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     parent::__construct($chunk, $nbt);
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:4,代码来源:EnchantTable.php

示例15: saveNBT

 public function saveNBT()
 {
     parent::saveNBT();
     unset($this->namedtag->Items);
 }
开发者ID:PepbookPvP,项目名称:Genisys,代码行数:5,代码来源:EnchantTable.php


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