Added some documentation on harvest level properties

This commit is contained in:
Dylan K. Taylor 2017-12-12 16:55:00 +00:00
parent e2e6b7516a
commit 0004e7429f
2 changed files with 21 additions and 0 deletions

View File

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

View File

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