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


PHP Item::isShears方法代码示例

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


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

示例1: getDrops

 public function getDrops(Item $item)
 {
     if ($item->isShears() || $item->isSword() >= Tool::TIER_WOODEN) {
         return [[Item::STRING, 0, 1]];
     } else {
         return [];
     }
 }
开发者ID:ecoron,项目名称:MinionsLandPE,代码行数:8,代码来源:Cobweb.php

示例2: getDrops

 public function getDrops(Item $item) : array
 {
     if ($item->isShears()) {
         return [[Item::DEAD_BUSH, 0, 1]];
     } else {
         return [[Item::STICK, 0, mt_rand(0, 2)]];
     }
 }
开发者ID:iTXTech,项目名称:Genisys,代码行数:8,代码来源:DeadBush.php

示例3: getDrops

 public function getDrops(Item $item)
 {
     if ($item->isShears()) {
         return [$this->id, $this->meta, 1];
     } elseif (mt_rand(0, 15) === 0) {
         return [Item::WHEAT_SEEDS, 0, 1];
     }
     return [];
 }
开发者ID:orlando092,项目名称:ImagicalMine,代码行数:9,代码来源:TallGrass.php

示例4: getDrops

 public function getDrops(Item $item) : array
 {
     if ($item->isShears()) {
         return [[Item::COBWEB, 0, 1]];
     } elseif ($item->isSword() >= Tool::TIER_WOODEN) {
         if ($item->getEnchantmentLevel(Enchantment::TYPE_MINING_SILK_TOUCH) > 0) {
             return [[Item::COBWEB, 0, 1]];
         } else {
             return [[Item::STRING, 0, 1]];
         }
     }
     return [];
 }
开发者ID:iTXTech,项目名称:Genisys,代码行数:13,代码来源:Cobweb.php

示例5: getDrops

 public function getDrops(Item $item) : array
 {
     $drops = [];
     if ($item->isShears() or $item->getEnchantmentLevel(Enchantment::TYPE_MINING_SILK_TOUCH) > 0) {
         $drops[] = [$this->id, $this->meta & 0x1, 1];
     } else {
         $fortunel = $item->getEnchantmentLevel(Enchantment::TYPE_MINING_FORTUNE);
         $fortunel = min(3, $fortunel);
         $rates = [20, 16, 12, 10];
         if (mt_rand(1, $rates[$fortunel]) === 1) {
             //Saplings
             $drops[] = [Item::SAPLING, $this->meta & 0x1 | 0x4, 1];
         }
     }
     return $drops;
 }
开发者ID:iTXTech,项目名称:Genisys,代码行数:16,代码来源:Leaves2.php

示例6: getDrops

 public function getDrops(Item $item)
 {
     if ($item->isShears()) {
         return [[$this->id, 0, 1]];
     } else {
         return [];
     }
 }
开发者ID:mattiasaxelsson,项目名称:PocketMine-MP,代码行数:8,代码来源:Vine.php

示例7: getDrops

 public function getDrops(Item $item) : array
 {
     $drops = [];
     if ($item->isShears()) {
         $drops[] = [Item::LEAVES, $this->meta & 0x3, 1];
     } else {
         if (mt_rand(1, 20) === 1) {
             //Saplings
             $drops[] = [Item::SAPLING, $this->meta & 0x3, 1];
         }
         if (($this->meta & 0x3) === self::OAK and mt_rand(1, 200) === 1) {
             //Apples
             $drops[] = [Item::APPLE, 0, 1];
         }
     }
     return $drops;
 }
开发者ID:PepbookPvP,项目名称:Genisys,代码行数:17,代码来源:Leaves.php

示例8: getDrops

 public function getDrops(Item $item)
 {
     $drops = [];
     if ($item->isShears()) {
         $drops[] = [Item::LEAVES2, $this->meta & 0x3, 1];
     } else {
         if (\mt_rand(1, 20) === 1) {
             //Saplings
             $drops[] = [Item::SAPLING, $this->meta & 0x3, 1];
         }
     }
     return $drops;
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:13,代码来源:Leaves2.php

示例9: getDrops

 public function getDrops(Item $item)
 {
     if ($item->isShears()) {
         return [[Item::LEAVES2, $this->meta & 0x3, 1]];
     }
     if (mt_rand(1, 20) === 1) {
         //Saplings
         return [[Item::SAPLING, $this->meta & 0x3, 1]];
     }
     return [];
 }
开发者ID:robozeri,项目名称:Yuriko-MP,代码行数:11,代码来源:Leaves2.php

示例10: getDrops

 public function getDrops(Item $item) : array
 {
     $drops = [];
     if ($item->isShears() or $item->getEnchantmentLevel(Enchantment::TYPE_MINING_SILK_TOUCH) > 0) {
         $drops[] = [Item::LEAVES, $this->meta & 0x3, 1];
     } else {
         $fortunel = $item->getEnchantmentLevel(Enchantment::TYPE_MINING_FORTUNE);
         $fortunel = $fortunel > 3 ? 3 : $fortunel;
         $rates = [20, 16, 12, 10];
         if (mt_rand(1, $rates[$fortunel]) === 1) {
             //Saplings
             $drops[] = [Item::SAPLING, $this->meta & 0x3, 1];
         }
         $rates = [200, 180, 160, 120];
         if (($this->meta & 0x3) === self::OAK and mt_rand(1, $rates[$fortunel]) === 1) {
             //Apples
             $drops[] = [Item::APPLE, 0, 1];
         }
     }
     return $drops;
 }
开发者ID:yungtechboy1,项目名称:Genisys,代码行数:21,代码来源:Leaves.php

示例11: getDrops

 public function getDrops(Item $item)
 {
     if ($item->isShears()) {
         return [[Item::VINE, 0, 1]];
     }
     return [];
 }
开发者ID:robozeri,项目名称:Yuriko-MP,代码行数:7,代码来源:Vine.php


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