本文整理匯總了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 [];
}
}
示例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)]];
}
}
示例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 [];
}
示例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 [];
}
示例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;
}
示例6: getDrops
public function getDrops(Item $item)
{
if ($item->isShears()) {
return [[$this->id, 0, 1]];
} else {
return [];
}
}
示例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;
}
示例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;
}
示例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 [];
}
示例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;
}
示例11: getDrops
public function getDrops(Item $item)
{
if ($item->isShears()) {
return [[Item::VINE, 0, 1]];
}
return [];
}