mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
PHP8: use match function
This commit is contained in:
parent
1275a4558c
commit
f74e6e0638
41 changed files with 300 additions and 574 deletions
|
|
@ -10,21 +10,15 @@ class CobblestoneBlock extends SolidBlock{
|
|||
public function getBreakTime(Item $item, Player $player){
|
||||
if(($player->gamemode & 0x01) === 0x01){
|
||||
return 0.20;
|
||||
}
|
||||
switch($item->getPickaxeLevel()){
|
||||
case 5:
|
||||
return 0.4;
|
||||
case 4:
|
||||
return 0.5;
|
||||
case 3:
|
||||
return 0.75;
|
||||
case 2:
|
||||
return 0.25;
|
||||
case 1:
|
||||
return 1.5;
|
||||
default:
|
||||
return 10;
|
||||
}
|
||||
return match ($item->getPickaxeLevel()) {
|
||||
5 => 0.4,
|
||||
4 => 0.5,
|
||||
3 => 0.75,
|
||||
2 => 0.25,
|
||||
1 => 1.5,
|
||||
default => 10,
|
||||
};
|
||||
}
|
||||
|
||||
public function getDrops(Item $item, Player $player){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue