pocketmine\entity\Cow::getDrops PHP Метод

getDrops() публичный Метод

public getDrops ( )
    public function getDrops()
    {
        $lootingL = 0;
        $cause = $this->lastDamageCause;
        if ($cause instanceof EntityDamageByEntityEvent and $cause->getDamager() instanceof Player) {
            $lootingL = $cause->getDamager()->getItemInHand()->getEnchantmentLevel(Enchantment::TYPE_WEAPON_LOOTING);
        }
        $drops = array(ItemItem::get(ItemItem::RAW_BEEF, 0, mt_rand(1, 3 + $lootingL)));
        $drops[] = ItemItem::get(ItemItem::LEATHER, 0, mt_rand(0, 2 + $lootingL));
        //TODO: add judgement for Steak
        /*if ($this->lastDamageCause instanceof EntityDamageByEntityEvent and $this->lastDamageCause->getEntity() instanceof Player) {
        			$drops[] = ItemItem::get(ItemItem::LEATHER, 0, mt_rand(0,2));
        		}*/
        return $drops;
    }