Fixed bows not getting damaged

This commit is contained in:
Shoghi Cervantes 2014-09-01 11:43:48 +02:00
parent c5626bae34
commit e047b6a870
3 changed files with 2 additions and 2 deletions

View File

@ -1576,6 +1576,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
if($this->isSurvival()){
$this->inventory->removeItem(Item::get(Item::ARROW, 0, 1));
$bow->setDamage($bow->getDamage() + 1);
$this->inventory->setItemInHand($bow);
if($bow->getDamage() >= 385){
$this->inventory->setItemInHand(Item::get(Item::AIR, 0, 0));
}

View File

@ -84,7 +84,6 @@ class Arrow extends Projectile{
$nearDistance = PHP_INT_MAX;
$nearEntity = null;
foreach($list as $entity){
if(!$entity->canCollideWith($this) or ($entity === $this->shootingEntity and $this->ticksLived < 5)){
continue;

View File

@ -24,7 +24,7 @@ namespace pocketmine\item;
class Bow extends Tool{
public function __construct($meta = 0, $count = 1){
parent::__construct(self::BOW, 0, $count, "Bow");
parent::__construct(self::BOW, $meta, $count, "Bow");
}
}