mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Added Durable class, fixed some tools not breaking correctly, removed some boilerplate code
This commit is contained in:
@ -99,12 +99,7 @@ class Bow extends Tool{
|
||||
$entity->setMotion($entity->getMotion()->multiply($ev->getForce()));
|
||||
if($player->isSurvival()){
|
||||
$player->getInventory()->removeItem(ItemFactory::get(Item::ARROW, 0, 1));
|
||||
$this->setDamage($this->getDamage() + 1);
|
||||
if($this->getDamage() >= $this->getMaxDurability()){
|
||||
$player->getInventory()->setItemInHand(ItemFactory::get(Item::AIR, 0, 0));
|
||||
}else{
|
||||
$player->getInventory()->setItemInHand($this);
|
||||
}
|
||||
$this->applyDamage(1);
|
||||
}
|
||||
|
||||
if($entity instanceof Projectile){
|
||||
|
Reference in New Issue
Block a user