Fixed too-fast break times with wrong tool types

This commit is contained in:
Dylan K. Taylor 2017-12-11 14:26:15 +00:00
parent a02af1053f
commit 45983acc0d

View File

@ -196,7 +196,13 @@ class Block extends Position implements BlockIds, Metadatable{
}
public function canBeBrokenWith(Item $item) : bool{
return $this->getHardness() !== -1;
if($this->getHardness() < 0){
return false;
}
$toolType = $this->getToolType();
return $toolType === BlockToolType::TYPE_NONE or ($toolType & $item->getBlockToolType()) !== 0;
//TODO: check tool harvest level (tier)
}
/**