mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
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:
@ -55,6 +55,10 @@ class EnderChest extends Chest{
|
||||
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{
|
||||
$faces = [
|
||||
0 => 4,
|
||||
@ -98,8 +102,10 @@ class EnderChest extends Chest{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item) : array{
|
||||
if($item->isPickaxe() >= TieredTool::TIER_WOODEN){
|
||||
return [ItemFactory::get(Item::OBSIDIAN, 0, 8)];
|
||||
if($this->canBeBrokenWith($item)){
|
||||
return [
|
||||
ItemFactory::get(Item::OBSIDIAN, 0, 8)
|
||||
];
|
||||
}
|
||||
|
||||
return [];
|
||||
|
Reference in New Issue
Block a user