mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +00:00
Merge branch 'stable'
# Conflicts: # .travis.yml # resources/vanilla # src/block/BlockToolType.php # src/network/mcpe/protocol/types/entity/MetadataProperty.php # tests/travis/setup-php.yml
This commit is contained in:
@@ -23,11 +23,24 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\item;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\block\BlockToolType;
|
||||
use pocketmine\entity\Entity;
|
||||
|
||||
class Hoe extends TieredTool{
|
||||
|
||||
public function getBlockToolType() : int{
|
||||
return BlockToolType::HOE;
|
||||
}
|
||||
|
||||
public function onAttackEntity(Entity $victim) : bool{
|
||||
return $this->applyDamage(1);
|
||||
}
|
||||
|
||||
public function onDestroyBlock(Block $block) : bool{
|
||||
if(!$block->getBreakInfo()->breaksInstantly()){
|
||||
return $this->applyDamage(1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user