當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Spawnable::__construct方法代碼示例

本文整理匯總了PHP中pocketmine\tile\Spawnable::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Spawnable::__construct方法的具體用法?PHP Spawnable::__construct怎麽用?PHP Spawnable::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pocketmine\tile\Spawnable的用法示例。


在下文中一共展示了Spawnable::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     if (!isset($nbt->SkullType)) {
         $nbt->SkullType = new String("SkullType", 0);
     }
     parent::__construct($chunk, $nbt);
 }
開發者ID:Anapopo,項目名稱:Genisys,代碼行數:7,代碼來源:Skull.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: __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

示例4: __construct

 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     parent::__construct($chunk, $nbt);
     $this->inventory = new FurnaceInventory($this);
     if (!isset($this->namedtag->Items) or !$this->namedtag->Items instanceof Enum) {
         $this->namedtag->Items = new Enum("Items", []);
         $this->namedtag->Items->setTagType(NBT::TAG_Compound);
     }
     for ($i = 0; $i < $this->getSize(); ++$i) {
         $this->inventory->setItem($i, $this->getItem($i));
     }
     if (!isset($this->namedtag->BurnTime) or $this->namedtag["BurnTime"] < 0) {
         $this->namedtag->BurnTime = new Short("BurnTime", 0);
     }
     if (!isset($this->namedtag->CookTime) or $this->namedtag["CookTime"] < 0 or $this->namedtag["BurnTime"] === 0 and $this->namedtag["CookTime"] > 0) {
         $this->namedtag->CookTime = new Short("CookTime", 0);
     }
     if (!isset($this->namedtag->MaxTime)) {
         $this->namedtag->MaxTime = new Short("BurnTime", $this->namedtag["BurnTime"]);
         $this->namedtag->BurnTicks = new Short("BurnTicks", 0);
     }
     if ($this->namedtag["BurnTime"] > 0) {
         $this->scheduleUpdate();
     }
 }
開發者ID:ecoron,項目名稱:MinionsLandPE,代碼行數:25,代碼來源:Furnace.php

示例5: __construct

 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     parent::__construct($chunk, $nbt);
     $this->inventory = new EnchantInventory($this);
     $this->namedtag->Items = new EnumTag("Items", []);
     $this->namedtag->Items->setTagType(NBT::TAG_Compound);
     $this->scheduleUpdate();
 }
開發者ID:PepbookPvP,項目名稱:Genisys,代碼行數:8,代碼來源:EnchantTable.php

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

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

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

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

示例10: __construct

 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     parent::__construct($chunk, $nbt);
     $this->inventory = new ChestInventory($this);
     if (!isset($this->namedtag->Items) or !$this->namedtag->Items instanceof Enum) {
         $this->namedtag->Items = new Enum("Items", []);
         $this->namedtag->Items->setTagType(NBT::TAG_Compound);
     }
     for ($i = 0; $i < $this->getSize(); ++$i) {
         $this->inventory->setItem($i, $this->getItem($i));
     }
 }
開發者ID:TexusDark,項目名稱:Ananas-MP,代碼行數:12,代碼來源:Chest.php

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

示例12: __construct

 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     parent::__construct($chunk, $nbt);
     $this->inventory = new DropperInventory($this);
     if (!isset($this->namedtag->Items) or !$this->namedtag->Items instanceof ListTag) {
         $this->namedtag->Items = new ListTag("Items", []);
         $this->namedtag->Items->setTagType(NBT::TAG_Compound);
     }
     for ($i = 0; $i < $this->getSize(); ++$i) {
         $this->inventory->setItem($i, $this->getItem($i));
     }
     $this->scheduleUpdate();
 }
開發者ID:iTXTech,項目名稱:Genisys,代碼行數:13,代碼來源:Dropper.php

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

示例14: __construct

 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     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:TexusDark,項目名稱:Ananas-MP,代碼行數:16,代碼來源:Sign.php

示例15: __construct

 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     parent::__construct($chunk, $nbt);
     $this->inventory = new HopperInventory($this);
     if (!isset($this->namedtag->Items) or !$this->namedtag->Items instanceof ListTag) {
         $this->namedtag->Items = new ListTag("Items", []);
         $this->namedtag->Items->setTagType(NBT::TAG_Compound);
     }
     for ($i = 0; $i < $this->getSize(); ++$i) {
         $this->inventory->setItem($i, $this->getItem($i));
     }
     if (!isset($this->namedtag->BurnTime) or $this->namedtag["TransferCooldown"] < 0) {
         $this->namedtag->BurnTime = new IntTag("TransferCooldown", 0);
     }
     if ($this->namedtag["TransferCooldown"] > 0) {
         $this->scheduleUpdate();
     }
 }
開發者ID:Creeperface01,項目名稱:ImagicalMine,代碼行數:18,代碼來源:Hopper.php


注:本文中的pocketmine\tile\Spawnable::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。