Fixed stained/hardened clay being harvestable without a pickaxe, close #1803

This commit is contained in:
Dylan K. Taylor 2017-12-13 11:59:35 +00:00
parent 50f3231629
commit c669819bbb
2 changed files with 7 additions and 14 deletions

View File

@ -23,6 +23,8 @@ declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\item\TieredTool;
class HardenedClay extends Solid{
protected $id = self::HARDENED_CLAY;
@ -39,6 +41,10 @@ class HardenedClay extends Solid{
return BlockToolType::TYPE_PICKAXE;
}
public function getToolHarvestLevel() : int{
return TieredTool::TIER_WOODEN;
}
public function getHardness() : float{
return 1.25;
}

View File

@ -25,24 +25,11 @@ namespace pocketmine\block;
use pocketmine\block\utils\ColorBlockMetaHelper;
class StainedClay extends Solid{
class StainedClay extends HardenedClay{
protected $id = self::STAINED_CLAY;
public function __construct(int $meta = 0){
$this->meta = $meta;
}
public function getHardness() : float{
return 1.25;
}
public function getToolType() : int{
return BlockToolType::TYPE_PICKAXE;
}
public function getName() : string{
return ColorBlockMetaHelper::getColorFromMeta($this->meta) . " Stained Clay";
}
}