mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +00:00
27 lines
581 B
PHP
27 lines
581 B
PHP
<?php
|
|
|
|
abstract class ItemAxe extends ItemTool
|
|
{
|
|
public function isAxe(){
|
|
return true;
|
|
}
|
|
|
|
public function getLevel(){
|
|
return match ($this->id) {
|
|
WOODEN_AXE => 1,
|
|
GOLDEN_AXE => 2,
|
|
STONE_AXE => 3,
|
|
IRON_AXE => 4,
|
|
DIAMOND_AXE => 5,
|
|
default => false,
|
|
};
|
|
}
|
|
public function getDestroySpeed($id, $meta){
|
|
$effMult = ItemTool::TIER_EFFICIENCY_MULTIPLIER[$this->getLevel()] ?? ItemTool::TIER_EFFICIENCY_MULTIPLIER[0];
|
|
|
|
$mat = StaticBlock::getMaterial($id);
|
|
if($mat == Material::$wood) return $effMult;
|
|
return parent::getDestroySpeed($id, $meta);
|
|
}
|
|
}
|
|
|