mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +00:00
PHP8: use match function
This commit is contained in:
parent
1275a4558c
commit
f74e6e0638
41 changed files with 300 additions and 574 deletions
|
|
@ -7,20 +7,14 @@ abstract class ItemAxe extends ItemTool
|
|||
}
|
||||
|
||||
public function getLevel(){
|
||||
switch($this->id){
|
||||
case WOODEN_AXE:
|
||||
return 1;
|
||||
case GOLDEN_AXE:
|
||||
return 2;
|
||||
case STONE_AXE:
|
||||
return 3;
|
||||
case IRON_AXE:
|
||||
return 4;
|
||||
case DIAMOND_AXE:
|
||||
return 5;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return match ($this->id) {
|
||||
WOODEN_AXE => 1,
|
||||
GOLDEN_AXE => 2,
|
||||
STONE_AXE => 3,
|
||||
IRON_AXE => 4,
|
||||
DIAMOND_AXE => 5,
|
||||
default => false,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue