mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Refactored tool efficiency handling
This fixes lots of bugs with things like wool, cobwebs, swords.
This commit is contained in:
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\item;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\block\BlockToolType;
|
||||
|
||||
class Sword extends TieredTool{
|
||||
@ -42,4 +43,12 @@ class Sword extends TieredTool{
|
||||
public function getBlockToolHarvestLevel() : int{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function getMiningEfficiency(Block $block) : float{
|
||||
return parent::getMiningEfficiency($block) * 1.5; //swords break any block 1.5x faster than hand
|
||||
}
|
||||
|
||||
protected function getBaseMiningEfficiency() : float{
|
||||
return 10;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user