mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
PHP8: use match function
This commit is contained in:
parent
1275a4558c
commit
f74e6e0638
41 changed files with 300 additions and 574 deletions
|
|
@ -16,20 +16,14 @@ abstract class ItemHoe extends ItemTool
|
|||
}
|
||||
|
||||
public function getLevel(){
|
||||
switch($this->id){
|
||||
case WOODEN_HOE:
|
||||
return 1;
|
||||
case GOLDEN_HOE:
|
||||
return 2;
|
||||
case STONE_HOE:
|
||||
return 3;
|
||||
case IRON_HOE:
|
||||
return 4;
|
||||
case DIAMOND_HOE:
|
||||
return 5;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return match ($this->id) {
|
||||
WOODEN_HOE => 1,
|
||||
GOLDEN_HOE => 2,
|
||||
STONE_HOE => 3,
|
||||
IRON_HOE => 4,
|
||||
DIAMOND_HOE => 5,
|
||||
default => false,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue