Added harvest level properties to applicable blocks

this fixes block-breaking animations with wrong tools, and also finally resolves the long-standing hierarchy problem in Stair.
This commit is contained in:
Dylan K. Taylor
2017-12-11 15:08:15 +00:00
parent dbc180315e
commit 99fe63b2a3
52 changed files with 213 additions and 269 deletions

View File

@ -49,6 +49,10 @@ class BoneBlock extends Solid{
return BlockToolType::TYPE_PICKAXE;
}
public function getToolHarvestLevel() : int{
return TieredTool::TIER_WOODEN;
}
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
$this->meta = PillarRotationHelper::getMetaFromFace($this->meta, $face);
return $this->getLevel()->setBlock($blockReplace, $this, true, true);
@ -57,13 +61,4 @@ class BoneBlock extends Solid{
public function getVariantBitmask() : int{
return 0x03;
}
public function getDrops(Item $item) : array{
if($item->isPickaxe() >= TieredTool::TIER_WOODEN){
return parent::getDrops($item);
}
return [];
}
}