Rename Block->canBeBrokenWith() to isCompatibleWithTool() and add documentation

This name better describes it. "can be broken with" implies that items which this returns false for cannot destroy the block at all, which is incorrect. What this actually returns is whether the item is the best tool to use to break the block.
This commit is contained in:
Dylan K. Taylor
2017-12-12 19:51:31 +00:00
parent 0004e7429f
commit da3640357c
11 changed files with 25 additions and 14 deletions

View File

@ -52,7 +52,7 @@ class LapisOre extends Solid{
}
public function getDrops(Item $item) : array{
if($this->canBeBrokenWith($item)){
if($this->isCompatibleWithTool($item)){
return [
ItemFactory::get(Item::DYE, 4, mt_rand(4, 8))
];