mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 12:27:51 +00:00
Fixed too-fast break times with wrong tool types
This commit is contained in:
parent
a02af1053f
commit
45983acc0d
@ -196,7 +196,13 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function canBeBrokenWith(Item $item) : bool{
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user