mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Remove Tool <-> Block circular dependency in efficiency calculation
This commit is contained in:
@ -325,7 +325,7 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
$base *= 5;
|
||||
}
|
||||
|
||||
$efficiency = $item->getMiningEfficiency($this);
|
||||
$efficiency = $item->getMiningEfficiency(($this->getToolType() & $item->getBlockToolType()) !== 0);
|
||||
if($efficiency <= 0){
|
||||
throw new \InvalidArgumentException(get_class($item) . " has invalid mining efficiency: expected >= 0, got $efficiency");
|
||||
}
|
||||
|
Reference in New Issue
Block a user