mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 08:39:53 +00:00
Fixed bows not getting damaged
This commit is contained in:
parent
c5626bae34
commit
e047b6a870
@ -1576,6 +1576,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
if($this->isSurvival()){
|
if($this->isSurvival()){
|
||||||
$this->inventory->removeItem(Item::get(Item::ARROW, 0, 1));
|
$this->inventory->removeItem(Item::get(Item::ARROW, 0, 1));
|
||||||
$bow->setDamage($bow->getDamage() + 1);
|
$bow->setDamage($bow->getDamage() + 1);
|
||||||
|
$this->inventory->setItemInHand($bow);
|
||||||
if($bow->getDamage() >= 385){
|
if($bow->getDamage() >= 385){
|
||||||
$this->inventory->setItemInHand(Item::get(Item::AIR, 0, 0));
|
$this->inventory->setItemInHand(Item::get(Item::AIR, 0, 0));
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,6 @@ class Arrow extends Projectile{
|
|||||||
$nearDistance = PHP_INT_MAX;
|
$nearDistance = PHP_INT_MAX;
|
||||||
$nearEntity = null;
|
$nearEntity = null;
|
||||||
|
|
||||||
|
|
||||||
foreach($list as $entity){
|
foreach($list as $entity){
|
||||||
if(!$entity->canCollideWith($this) or ($entity === $this->shootingEntity and $this->ticksLived < 5)){
|
if(!$entity->canCollideWith($this) or ($entity === $this->shootingEntity and $this->ticksLived < 5)){
|
||||||
continue;
|
continue;
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class Bow extends Tool{
|
class Bow extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::BOW, 0, $count, "Bow");
|
parent::__construct(self::BOW, $meta, $count, "Bow");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user