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:
Dylan K. Taylor
2020-12-11 22:44:04 +00:00
6 changed files with 74 additions and 100 deletions

View File

@@ -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;
}
}