diff --git a/src/pocketmine/block/Block.php b/src/pocketmine/block/Block.php index 5d7663485..1c3a29434 100644 --- a/src/pocketmine/block/Block.php +++ b/src/pocketmine/block/Block.php @@ -202,6 +202,18 @@ class Block extends Position implements BlockIds, Metadatable{ return BlockToolType::TYPE_NONE; } + /** + * Returns the level of tool required to harvest this block (for normal blocks). When the tool type matches the + * block's required tool type, the tool must have a harvest level greater than or equal to this value to be able to + * successfully harvest the block. + * + * If the block requires a specific minimum tier of tiered tool, the minimum tier required should be returned. + * Otherwise, 1 should be returned if a tool is required, 0 if not. + * + * @see Item::getBlockToolHarvestLevel() + * + * @return int + */ public function getToolHarvestLevel() : int{ return 0; } diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index d6c066688..01d080282 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -752,6 +752,15 @@ class Item implements ItemIds, \JsonSerializable{ return BlockToolType::TYPE_NONE; } + /** + * Returns the harvesting power that this tool has. This affects what blocks it can mine when the tool type matches + * the mined block. + * This should return 1 for non-tiered tools, and the tool tier for tiered tools. + * + * @see Block::getToolHarvestLevel() + * + * @return int + */ public function getBlockToolHarvestLevel() : int{ return 0; }