diff --git a/src/block/BlockBreakInfo.php b/src/block/BlockBreakInfo.php index 6d44f8820..0290b02ab 100644 --- a/src/block/BlockBreakInfo.php +++ b/src/block/BlockBreakInfo.php @@ -27,6 +27,16 @@ use pocketmine\item\Item; use function get_class; class BlockBreakInfo{ + /** + * If the tool is the correct type and high enough harvest level (tool tier), base break time is hardness multiplied + * by this value. + */ + public const COMPATIBLE_TOOL_MULTIPLIER = 1.5; + /** + * If the tool is an incorrect type or too low harvest level (tool tier), base break time is hardness multiplied by + * this value. + */ + public const INCOMPATIBLE_TOOL_MULTIPLIER = 5.0; private float $hardness; private float $blastResistance; @@ -121,9 +131,9 @@ class BlockBreakInfo{ public function getBreakTime(Item $item) : float{ $base = $this->hardness; if($this->isToolCompatible($item)){ - $base *= 1.5; + $base *= self::COMPATIBLE_TOOL_MULTIPLIER; }else{ - $base *= 5; + $base *= self::INCOMPATIBLE_TOOL_MULTIPLIER; } $efficiency = $item->getMiningEfficiency(($this->toolType & $item->getBlockToolType()) !== 0);